Versions in this module Expand all Collapse all v1 v1.0.0 Apr 17, 2022 Changes in this version + const MysqlErrorText + const PgErrorText + var ErrConfigRequired = errors.New("config is required") + var ErrMissingPassword = errors.New("missing password") + var ErrMissingUsername = errors.New("missing username") + var ErrNoNilCredentials = errors.New("store cannot return nil credentials") + var MySQLAuthError = errorTester(MysqlErrorText) + var PostgreSQLAuthError = errorTester(PgErrorText) + func MysqlFormatter(username, password, host string, port int, db string, opts map[string]string) string + func PgFormatter(username, password, host string, port int, db string, opts map[string]string) string + func PgKVFormatter(username, password, host string, port int, db string, opts map[string]string) string + func Register(name string, f factory) error + type AuthError func(e error) bool + type Config struct + DB string + Formatter Formatter + Host string + Opts map[string]string + Port int + Retries int + type Connector struct + func NewConnector(s Store, driverName string, cfg *Config) (*Connector, error) + func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) + func (c *Connector) Driver() driver.Driver + type Credentials interface + GetPassword func() string + GetUsername func() string + type Driver struct + AuthError AuthError + Driver driver.Driver + Formatter Formatter + func CreateDriver(name string) (*Driver, error) + type Formatter func(username string, password string, host string, port int, db string, ...) string + type Store interface + Get func(ctx context.Context) (Credentials, error) + Refresh func(ctx context.Context) (Credentials, error)