Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect creates a connection to the PostgreSQL instance and applies any unapplied database migrations. A non-nil error is returned to indicate failure.
func NewNotifierRepository ¶
func NewNotifierRepository(db Database) notifiers.NotifierRepository
NewNotifierRepository instantiates a PostgreSQL implementation of notifier repository.
Types ¶
type Config ¶
type Config struct {
Host string
Port string
User string
Pass string
Name string
SSLMode string
SSLCert string
SSLKey string
SSLRootCert string
}
Config defines the options that are used when connecting to a PostgreSQL instance
type Database ¶
type Database interface {
NamedExecContext(context.Context, string, interface{}) (sql.Result, error)
QueryRowxContext(context.Context, string, ...interface{}) *sqlx.Row
NamedQueryContext(context.Context, string, interface{}) (*sqlx.Rows, error)
GetContext(context.Context, interface{}, string, ...interface{}) error
BeginTxx(context.Context, *sql.TxOptions) (*sqlx.Tx, error)
}
Database provides a database interface
func NewDatabase ¶
NewDatabase creates a NotifierDatabase instance
Click to show internal directories.
Click to hide internal directories.