Documentation
¶
Index ¶
- func ConfigToTLSConfig(c *TLSConfig) (*tls.Config, error)
- func Listen(server *http.Server, flags *FlagConfig, logger log.Logger) errordeprecated
- func ListenAndServe(server *http.Server, flags *FlagConfig, logger log.Logger) error
- func Serve(l net.Listener, server *http.Server, flags *FlagConfig, logger log.Logger) error
- func ServeMultiple(listeners []net.Listener, server *http.Server, flags *FlagConfig, ...) error
- func Validate(tlsConfigPath string) error
- type Cipher
- type Config
- type Curve
- type FlagConfig
- type HTTPConfig
- type TLSConfig
- type TLSVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigToTLSConfig ¶
ConfigToTLSConfig generates the golang tls.Config from the TLSConfig struct.
func ListenAndServe ¶
ListenAndServe starts the server on addresses given in WebListenAddresses in the FlagConfig or instead uses systemd socket activated listeners if WebSystemdSocket in the FlagConfig is true. The FlagConfig is also passed on to ServeMultiple.
func Serve ¶
Server starts the server on the given listener. Based on the file path WebConfigFile in the FlagConfig, TLS or basic auth could be enabled.
func ServeMultiple ¶ added in v0.8.0
func ServeMultiple(listeners []net.Listener, server *http.Server, flags *FlagConfig, logger log.Logger) error
ServeMultiple starts the server on the given listeners. The FlagConfig is also passed on to Serve.
Types ¶
type Cipher ¶ added in v0.8.0
type Cipher uint16
func (Cipher) MarshalYAML ¶ added in v0.8.0
func (*Cipher) UnmarshalYAML ¶ added in v0.8.0
type Config ¶
type Config struct {
TLSConfig TLSConfig `yaml:"tls_server_config"`
HTTPConfig HTTPConfig `yaml:"http_server_config"`
Users map[string]config_util.Secret `yaml:"basic_auth_users"`
}
type Curve ¶ added in v0.8.0
func (*Curve) MarshalYAML ¶ added in v0.8.0
func (*Curve) UnmarshalYAML ¶ added in v0.8.0
type FlagConfig ¶ added in v0.8.0
type HTTPConfig ¶ added in v0.8.0
type TLSConfig ¶ added in v0.8.0
type TLSConfig struct {
TLSCertPath string `yaml:"cert_file"`
TLSKeyPath string `yaml:"key_file"`
ClientAuth string `yaml:"client_auth_type"`
ClientCAs string `yaml:"client_ca_file"`
CipherSuites []Cipher `yaml:"cipher_suites"`
CurvePreferences []Curve `yaml:"curve_preferences"`
MinVersion TLSVersion `yaml:"min_version"`
MaxVersion TLSVersion `yaml:"max_version"`
PreferServerCipherSuites bool `yaml:"prefer_server_cipher_suites"`
}
func (*TLSConfig) SetDirectory ¶ added in v0.8.0
SetDirectory joins any relative file paths with dir.
type TLSVersion ¶ added in v0.8.0
type TLSVersion uint16
func (*TLSVersion) MarshalYAML ¶ added in v0.8.0
func (tv *TLSVersion) MarshalYAML() (interface{}, error)
func (*TLSVersion) UnmarshalYAML ¶ added in v0.8.0
func (tv *TLSVersion) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.