Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ProviderProductionSet provides a new Manager for use in production. ProviderProductionSet = wire.NewSet(Provide, ProvideGORM, Cfg) // ProviderTestSet provides a new MockManager for testing. ProviderTestSet = wire.NewSet(ProvideMock, CfgTest) )
Functions ¶
Types ¶
type Config ¶
type Config struct { URL string MaxOpenConns int MaxIdleConns int ConnMaxLifetime time.Duration Logger *log.Log // contains filtered or unexported fields }
Config contains the parameters for configuring a database.
type Manager ¶
Manager manages a connection to a database.
type MockManager ¶
type MockManager struct { Manager *Manager Mock *sqlmock.Sqlmock }
MockManager manages a mock connection to a database.
func BuildTest ¶
func BuildTest(cfg Config) (*MockManager, func(), error)
func ProvideMock ¶
func ProvideMock(cfg *Config) (*MockManager, func(), error)
ProvideMock provies a new MockManager containing the given Config.
Click to show internal directories.
Click to hide internal directories.