Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFieldIsMissing is used with FieldError when a required field is missing. ErrFieldIsMissing = errors.New("field is required") // ErrFieldWrongFormat is used with FieldError when a field has not the required format. ErrFieldWrongFormat = errors.New("field input has wrong format") )
Functions ¶
func ValidateTLSFiles ¶
ValidateTLSFiles checks that cert and key are valid X509 certificates.
Types ¶
type Addr ¶
type Addr string
Addr represents a listener address
func AddrFromNetAddr ¶
AddrFromNetAddr creates a new Addr from net.Addr
func AddrFromString ¶
AddrFromString creates a new Addr from given string. Addr can be used in different variations. First, a simple ip-port combination (127.0.0.1:30221). To specify only the port, simply specify :$PORT. Then the daemon binds to all IP addresses and listen and $PORT. If you want to use the next free port you can specify port 0. If you pass the string "socket-activation" the socket activation of systemd is used. Additionally it is possible to define a socket name, which is separated by @ (socket-activation@nice-socket-name)
func (Addr) IsSocketActivation ¶
IsSocketActivation checks if the Addr is a systemd-socket-activation
func (*Addr) Set ¶
Set satisfies the flag.Value interface. Also used by https://github.com/kelseyhightower/envconfig..
type Config ¶
type Config struct { // See comment for NewAddrFromString for possible configurations. Addr Addr `envconfig:"ADDR" ini:"addr" json:"addr" yaml:"addr"` TLSCert string `envconfig:"TLS_CERT" ini:"tls-cert" json:"tlsCert" yaml:"tlsCert"` TLSKey string `envconfig:"TLS_KEY" ini:"tls-key" json:"tlsKey" yaml:"tlsKey"` LetsEncryptEmail string `envconfig:"LETS_ENCRYPT_EMAIL" ini:"lets-encrypt-email" json:"letsEncryptEmail" yaml:"letsEncryptEmail"` LetsEncryptCacheDir string `envconfig:"LETS_ENCRYPT_CACHE_DIR" ini:"lets-encrypt-cache-dir" json:"letsEncryptCacheDir" yaml:"letsEncryptCacheDir"` LetsEncryptDomains LetsEncryptDomains `envconfig:"LETS_ENCRYPT_DOMAINS" ini:"lets-encrypt-domains" json:"letsEncryptDomains" yaml:"letsEncryptDomains"` }
Config defines possible configuration for the http daemon
func (Config) SocketName ¶
SocketName returns the socket name specified by the user. It is possible to define a socket name by appending it separated by an @ to SocketActivationPrefix in Config.Addr. If socket activation is not used, name will be empty a string and ok will be false.
type FieldError ¶
FieldError is returned when Listener is not valid.
type LetsEncryptDomains ¶
type LetsEncryptDomains []string
LetsEncryptDomains defines a list of domains for which a certificate should be requested or managed by Let's encrypt.
func LetsEncryptDomainsFromString ¶
func LetsEncryptDomainsFromString(value string) (domains LetsEncryptDomains, err error)
LetsEncryptDomainsFromString takes a list of comma seperated domains and creates a new LetsEncryptDomains list out of it.
func (*LetsEncryptDomains) Set ¶
func (dd *LetsEncryptDomains) Set(value string) (err error)
Set satisfies the flag.Value interface. Also used by https://github.com/kelseyhightower/envconfig..
func (LetsEncryptDomains) String ¶
func (dd LetsEncryptDomains) String() string