Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataSourceNamer ¶ added in v0.8.0
type DataSourceNamer interface {
DSN() string
}
DataSourceNamer is the interface that wraps the DSN method.
type Logger ¶ added in v0.8.0
type Logger struct {
// contains filtered or unexported fields
}
Logger holds the configuration settings for a logger.
type Option ¶ added in v0.1.1
type Option interface {
// contains filtered or unexported methods
}
Option provides options when loading configuration information.
func WithPrefix ¶ added in v0.1.1
WithPrefix adds a prefix to the name of the enviroment variables being referenced.
type Postgres ¶ added in v0.8.0
type Postgres struct {
// contains filtered or unexported fields
}
Postgres holds the configuration settings needed to connect to a postgres database. The DB, HOST and SSLMODE variables are required. The SSLMODE defaults to "enabled".
For sslmode setting, see https://www.postgresql.org/docs/current/libpq-ssl.html
func NewPostgres ¶ added in v0.8.0
NewPostgres returns the postgres configuration.
func (*Postgres) DSN ¶ added in v0.8.0
DSN returns a connection string corresponding to the postgres configuration.
See https://godoc.org/github.com/lib/pq for connection string parameters.
type SQLDatabase ¶ added in v0.8.0
type SQLDatabase struct { DataSourceNamer // contains filtered or unexported fields }
SQLDatabase holds the configuration information for an SQL database.
func NewSQLDatabase ¶ added in v0.8.0
func NewSQLDatabase(opts ...Option) (*SQLDatabase, error)
NewSQLDatabase returns the configuration of an SQL database.
func (*SQLDatabase) DriverName ¶ added in v0.8.0
func (db *SQLDatabase) DriverName() string
DriverName returns the name of the sql database driver.
type Server ¶ added in v0.8.0
type Server struct {
// contains filtered or unexported fields
}
Server holds the configuration settings for a server.
func (*Server) CACert ¶ added in v0.8.0
CACert returns the filepath of the certificate of the client CA. This is used when a mutual TLS connection is desired.
type TLS ¶ added in v0.7.0
type TLS interface { // Cert returns the file name of the PEM encoded public key. Cert() string // Key returns the file name of the PEM encoded private key. Key() string // CACert returns the file name of the PEM encoded public key of the client CA. CACert() string }
TLS contains the information necessary to create a tls.Config.