Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PostgresDBProviderSet = wire.NewSet( ProvidePostgresDBConn, ProvidePreInitPostgresDBConn, ProvidePostgresCounterDAO, )
PostgresDBProviderSet is a provider set for building a Postgres database
View Source
var ProvidePostgresCounterDAO = wire.NewSet( wire.Struct(new(PostgresCounterDAO), "DB", "Log"), wire.Bind(new(CounterDAO), new(*PostgresCounterDAO)), )
ProvidePostgresCounterDAO is a provider set for building a PostgresCounterDAO
Functions ¶
This section is empty.
Types ¶
type CounterDAO ¶
type CounterDAO interface { Value(ctx context.Context) (int, error) Increment(ctx context.Context) (int, error) }
CounterDAO is a generic interface for a DAO accessing a counter
type PostgresCounterDAO ¶
type PostgresCounterDAO struct { DB PostgresDBConn Log *log.MultiLogger }
PostgresCounterDAO implements a CounterDAO for a Postgres database
type PostgresDBConn ¶
PostgresDBConn is a database connection to a Postgres DB
func ProvidePostgresDBConn ¶
func ProvidePostgresDBConn(logger *log.MultiLogger, db PreInitPostgresDBConn) (PostgresDBConn, error)
ProvidePostgresDBConn performs schema initialization
type PreInitPostgresDBConn ¶
PreInitPostgresDBConn is a database connection to a Postgres DB which may not have initialized schema
func ProvidePreInitPostgresDBConn ¶
func ProvidePreInitPostgresDBConn(logger *log.MultiLogger, dbString config.DatabaseString) (PreInitPostgresDBConn, func(), error)
ProvidePreInitPostgresDBConn provides a PostgresDBConn by connecting to a database
Click to show internal directories.
Click to hide internal directories.