Documentation
¶
Index ¶
- func MigrateDown(sourceURL string, c PasswordConfig, l bool) (uint, error)
- func MigrateUp(sourceURL string, c PasswordConfig, l bool) (uint, error)
- func NewMigrate(sourceURL string, c PasswordConfig, l bool) (*migrate.Migrate, error)
- func NewPasswordDB(c PasswordConfig, local bool) (*sql.DB, error)
- type PasswordConfig
- type PostgresStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateDown ¶
func MigrateDown(sourceURL string, c PasswordConfig, l bool) (uint, error)
MigrateDown carries out database migration applying down migrations. Migrations are loaded from sourceURL directory on the host.
MigrateDown should be expected to result in a version of 0 as it reverts all previous Ups.
* sourceURL - location of the migrations * c - configuration for the database to carry out migration on * l - whether executing locally or on AWS
returns currently active migration version.
func MigrateUp ¶
func MigrateUp(sourceURL string, c PasswordConfig, l bool) (uint, error)
MigrateUp carries out database migration applying up migrations. Migrations are loaded from sourceURL directory on the host.
* sourceURL - location of the migrations * c - configuration for the database to carry out migration on * l - whether executing locally or on AWS
returns currently active migration version.
func NewMigrate ¶
func NewPasswordDB ¶
func NewPasswordDB(c PasswordConfig, local bool) (*sql.DB, error)
NewPasswordDB returns a database handle representing a pool of zero or more underlying connections that authenticate via username and password.
* c - used to configure database connection * local - true if application running locally, false if running on AWS
Types ¶
type PasswordConfig ¶
type PasswordConfig struct {
Host string `json:"host"`
Name string `json:"name"`
Password string `json:"password"`
Port int `json:"port"`
Username string `json:"username"`
}
PasswordConfig database connection details that authenticates via password.
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
func New ¶
func New(ds string) *PostgresStore
func (*PostgresStore) Load ¶
func (s *PostgresStore) Load(ctx context.Context, aggregateID store.ID, fromVersion, toVersion int32) (store.Stream, error)
Load the stream of events up to the version specified. When toVersion is 0, all events will be loaded. To start at the beginning, fromVersion should be set to 0