Documentation
¶
Index ¶
- Variables
- func InitAdvancedOptions(proxy bool) *conf.AdvancedConfig
- func PopulateConfigFromFile(path string, target interface{}) error
- func PopulateDefaults(target interface{}) error
- func PopulateFromArguments(target interface{}, argMap ArgMap)
- func ValidateFlagsets(sets []string) ([]string, error)
- func WriteDefaultConfigFile(name string, definition interface{}) error
- type Admin
- type ArgMap
- type CliFlags
- type FlagSetValidationError
- type ImpressionListener
- type Integrations
- type Logging
- type Slack
- type TLS
Constants ¶
This section is empty.
Variables ¶
var ErrNoFile = errors.New("no config file provided")
ErrNoFile is the error to return when an empty config file si passed
Functions ¶
func InitAdvancedOptions ¶
func InitAdvancedOptions(proxy bool) *conf.AdvancedConfig
InitAdvancedOptions initializes an advanced config with default values + overriden urls.
func PopulateConfigFromFile ¶
PopulateConfigFromFile parses a json config file and populates the config struct passed as an argument
func PopulateDefaults ¶
func PopulateDefaults(target interface{}) error
PopulateDefaults iterates the passed structure and populates the fields with the value defined in the `s-def` tag
func PopulateFromArguments ¶
func PopulateFromArguments(target interface{}, argMap ArgMap)
PopulateFromArguments examines target fields by reflection and populates them with the contents of argMap
func ValidateFlagsets ¶ added in v5.6.0
func WriteDefaultConfigFile ¶
WriteDefaultConfigFile writes the default config defition to a JSON file
Types ¶
type Admin ¶
type Admin struct {
Host string `json:"host" s-cli:"admin-host" s-def:"0.0.0.0" s-desc:"Host where the admin server will listen"`
Port int64 `json:"port" s-cli:"admin-port" s-def:"3010" s-desc:"Admin port where incoming connections will be accepted"`
Username string `json:"username" s-cli:"admin-username" s-def:"" s-desc:"HTTP basic auth username for admin endpoints"`
Password string `json:"password" s-cli:"admin-password" s-def:"" s-desc:"HTTP basic auth password for admin endpoints"`
SecureHC bool `json:"secureChecks" s-cli:"admin-secure-hc" s-def:"false" s-desc:"Secure Healthcheck endpoints as well."`
TLS TLS `json:"tls" s-nested:"true" s-cli-prefix:"admin"`
}
Admin configuration options
type ArgMap ¶
type ArgMap map[string]interface{}
ArgMap is a type alias used to hold values parsed from CLI arguments, used to populate a config structure
func MakeCliArgMapFor ¶
func MakeCliArgMapFor(source interface{}) ArgMap
MakeCliArgMapFor returns a list of cli parameter struct
type CliFlags ¶
type CliFlags struct {
ConfigFile *string
WriteDefaultConfigFile *string
VersionInfo *bool
RawConfig ArgMap
}
CliFlags defines the basic set of flags that are independent on the binary being executed & config required
func ParseCliArgs ¶
func ParseCliArgs(definition interface{}) *CliFlags
ParseCliArgs accepts a config options struct, parses it's definition (types + metadata) and builds the appropriate flag definitions. It then parses the flags, and returns the structure filled with argument values
type FlagSetValidationError ¶ added in v5.6.0
type FlagSetValidationError struct {
// contains filtered or unexported fields
}
func (FlagSetValidationError) Error ¶ added in v5.6.0
func (f FlagSetValidationError) Error() string
type ImpressionListener ¶
type ImpressionListener struct {
Endpoint string `json:"endpoint" s-cli:"impression-listener-endpoint" s-def:"" s-desc:"HTTP endpoint to forward impressions to"`
QueueSize int64 `json:"queueSize" s-cli:"impression-listener-queue-size" s-def:"100" s-desc:"max number of impressions bulks to queue"`
}
ImpressionListener configuration options
type Integrations ¶
type Integrations struct {
ImpressionListener ImpressionListener `json:"impressionListener" s-nested:"true"`
Slack Slack `json:"slack" s-nested:"true"`
}
Integrations configuration options
type Logging ¶
type Logging struct {
Level string `json:"level" s-cli:"log-level" s-def:"info" s-desc:"Log level (error|warning|info|debug|verbose)"`
Output string `json:"output" s-cli:"log-output" s-def:"stdout" s-desc:"Where to output logs (defaults to stdout)"`
RotationMaxFiles int64 `json:"rotationMaxFiles" s-cli:"log-rotation-max-files" s-def:"10" s-desc:"Max number of files to keep when rotating logs"`
RotationMaxSizeKb int64 `json:"rotationMaxSizeKb" s-cli:"log-rotation-max-size-kb" s-def:"1024" s-desc:"Maximum log file size in kbs"`
}
Logging configuration options
type Slack ¶
type Slack struct {
Webhook string `json:"webhook" s-cli:"slack-webhook" s-def:"" s-desc:"slack webhook to post log messages"`
Channel string `json:"channel" s-cli:"slack-channel" s-def:"" s-desc:"slack channel to post log messages"`
}
Slack configuration options
type TLS ¶ added in v5.3.0
type TLS struct {
Enabled bool `json:"enabled" s-cli:"tls-enabled" s-def:"false" s-desc:"Enable HTTPS on proxy endpoints"`
ClientValidation bool `json:"clientValidation" s-cli:"tls-client-validation" s-def:"false" s-desc:"Enable client cert validation"`
ServerName string `json:"serverName" s-cli:"tls-server-name" s-def:"" s-desc:"Server name as it appears in provided server-cert"`
CertChainFN string `json:"certChainFn" s-cli:"tls-cert-chain-fn" s-def:"" s-desc:"X509 Server certificate chain"`
PrivateKeyFN string `json:"privateKeyFn" s-cli:"tls-private-key-fn" s-def:"" s-desc:"PEM Private key file name"`
ClientValidationRootCert string `` /* 128-byte string literal not displayed */
MinTLSVersion string `json:"minTlsVersion" s-cli:"tls-min-tls-version" s-def:"1.3" s-desc:"Minimum TLS version to allow X.Y"`
AllowedCipherSuites string `json:"allowedCipherSuites" s-cli:"tls-allowed-cipher-suites" s-def:"" s-desc:"Comma-separated list of cipher suites to allow"`
}
TLS config options