postgres

package
v0.0.0-...-9358009 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package postgres provides the example domain's Postgres-backed adapter for its repository ports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StubRepository

type StubRepository struct {
	// contains filtered or unexported fields
}

StubRepository is a Postgres-backed domain.StubRepository, built over a bun.IDB so the same code runs against the pooled production *bun.DB and against a test transaction via dbtest.

func NewStubRepository

func NewStubRepository(db bun.IDB) *StubRepository

NewStubRepository constructs a StubRepository backed by db.

func (*StubRepository) Create

func (r *StubRepository) Create(ctx context.Context, s domain.Stub) error

Create stores s.

func (*StubRepository) Get

func (r *StubRepository) Get(ctx context.Context, id string) (domain.Stub, error)

Get retrieves the Stub with the given id, or domain.ErrStubNotFound.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址