Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingOptionPool = errors.New("missing option: pool")
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
func NewDatastore ¶
func NewDatastore(options ...DatastoreOption) (*Datastore, error)
type DatastoreOption ¶
type DatastoreOption interface {
// contains filtered or unexported methods
}
func WithLogger ¶
func WithLogger(logger *slog.Logger) DatastoreOption
func WithPool ¶
func WithPool(pool Pool) DatastoreOption
type Pool ¶
type Pool interface { Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error) Begin(ctx context.Context) (pgx.Tx, error) Close() }
Pool is an interface for a database pool. It's sole purpose is to abstract away the underlying implementation and allow for easy mocking, thus facilitating unit testutils. The NewPool function is used to create a new pool for code intended to be used in production.
Click to show internal directories.
Click to hide internal directories.