Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigOption ¶
type ConfigOption func(configBuilder)
ConfigOption represents a function to configure the postgres connection
func Credentials ¶
func Credentials(username, password string) ConfigOption
Credentials configures postgres with username and password
func DbName ¶
func DbName(dbName string) ConfigOption
DbName configures postgres with a database name
func HostAndPort ¶
func HostAndPort(hostname string, port int) ConfigOption
HostAndPort configures postgres with hostname and port number
func SslDisabled ¶
func SslDisabled() ConfigOption
SslDisabled configures postgres to not enable SSL
type TodosRepository ¶
type TodosRepository struct {
// contains filtered or unexported fields
}
TodosRepository is a postgres implementation of a base todos.TodosRepository
func NewTodosRepository ¶
func NewTodosRepository(db *sql.DB) *TodosRepository
NewTodosRepository creates a new Todos repository backed by a Postgres db.
Click to show internal directories.
Click to hide internal directories.