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 returns the data source name of the sql database. DSN() string }
DataSourceNamer is the interface that wraps the DSN method.
type Logger ¶ added in v0.8.0
type Logger interface { // Level returns the configured log level. Level() string // File returns the configured log file. File() string // Format returns the configured log format. Format() string }
Logger provides 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 interface { // DriverName returns the name of the sql database driver. DriverName() string DataSourceNamer }
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.
type Server ¶ added in v0.8.0
type Server interface { // Addr returns the network address the server will listen on. Addr() string // Cert returns the filepath of the certificate. Cert() string // Key returns the filepath of the certificate key. Key() string // CACert returns the filepath of the certificate of the client CA. // This is used when a mutual TLS connection is desired. CACert() string }
Server holds the configuration settings for a server.
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.