Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectionData ¶
func (ConnectionData) ConnString ¶
func (cd ConnectionData) ConnString() string
func (ConnectionData) DSN ¶
func (cd ConnectionData) DSN() string
type Connector ¶
type Connector interface {
Data() (ConnectionData, error)
}
Connector defines the interface for obtaining database connection information.
type ConnectorFunc ¶
type ConnectorFunc func() (ConnectionData, error)
ConnectorFunc is a helper type for function-only implementations of Connector
func (ConnectorFunc) Data ¶
func (cf ConnectorFunc) Data() (ConnectionData, error)
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements the functionality provided by the ezdb package
func (*DB) CreateDatabase ¶
CreateDatabase creates the database, for initial environment setup.
func (*DB) CreateMigration ¶
CreateMigration creates set of migration files with the current timestamp and given name.
func (*DB) MigrateAll ¶
MigrateAll applies all outstanding migrations to the database.
func (*DB) MigrateSteps ¶
MigrateSteps applies a specific number of migrations to the database. If steps are negative, migrations will be rolled back.
type EnvConnector ¶
type EnvConnector struct { UserKey string PasswordKey string HostKey string DbKey string PortKey string }
EnvConnector implements Connector by pulling values from environment variables.
func NewDefaultEnvConnector ¶
func NewDefaultEnvConnector() EnvConnector
func (EnvConnector) Data ¶
func (e EnvConnector) Data() (ConnectionData, error)