Documentation ¶
Overview ¶
Package config provides primitives for l3afd configuration ( i.e. l3afd.cfg) file.
Index ¶
- Constants
- func LoadConfigBool(confReader *config.Config, group, field string) bool
- func LoadConfigDuration(confReader *config.Config, group, field string) time.Duration
- func LoadConfigFloat(confReader *config.Config, group, field string) float64
- func LoadConfigInt(confReader *config.Config, group, field string) int
- func LoadConfigString(confReader *config.Config, group, field string) string
- func LoadConfigStringCSV(confReader *config.Config, group, field string) []string
- func LoadConfigStringEncKey(confReader *config.Config, group, field string) string
- func LoadConfigURL(confReader *config.Config, group, field string) *url.URL
- func LoadOptionalConfigBool(confReader *config.Config, group, field string, defaultValue bool) bool
- func LoadOptionalConfigDuration(confReader *config.Config, group, field string, defaultValue time.Duration) time.Duration
- func LoadOptionalConfigFloat(confReader *config.Config, group, field string, defaultValue float64) float64
- func LoadOptionalConfigInt(confReader *config.Config, group, field string, defaultValue int) int
- func LoadOptionalConfigString(confReader *config.Config, group, field, defaultValue string) string
- func LoadOptionalConfigStringCSV(confReader *config.Config, group, field string, defaultValue []string) []string
- func LoadOptionalConfigStringEncKey(confReader *config.Config, group, field, defaultValue string) string
- func LoadOptionalConfigURL(confReader *config.Config, group, field string, defaultValue *url.URL) *url.URL
- type Config
Constants ¶
const (
ENV_PROD = "PROD"
)
Variables ¶
This section is empty.
Functions ¶
func LoadConfigDuration ¶
func LoadConfigString ¶
LoadConfigString gets the value (as a string) for a field belonging to a group. If the group and field are present - it returns the value If the group or field are absent - it aborts the process Note: Values that are encrypted are decrypted using a global key
func LoadConfigStringCSV ¶
LoadConfigStringCSV splits a CSV config string value and returns the resulting slice of strings. An emptyDefault []string is returned if the config field is emptyDefault (as opposed to []string{""}, which strings.Split() would return).
func LoadConfigStringEncKey ¶
LoadConfigStringEncKey is similar to LoadConfigString, except that it accepts an optional decryption key.
func LoadOptionalConfigBool ¶
func LoadOptionalConfigFloat ¶
func LoadOptionalConfigInt ¶
func LoadOptionalConfigString ¶
LoadOptionalConfigString gets the value (as a string) for a field belonging to a group. If the group and field are present - it returns the value If the group or field are absent - it returns the supplied default value Note: Values that are encrypted are decrypted using a global key
Types ¶
type Config ¶
type Config struct { PIDFilename string DataCenter string BPFDir string BPFLogDir string MinKernelMajorVer int MinKernelMinorVer int EBPFRepoURL string HttpClientTimeout time.Duration MaxEBPFReStartCount int Environment string BpfMapDefaultPath string // Flag to enable chaining with root program BpfChainingEnabled bool // stats // Prometheus endpoint for pull/scrape the metrics. MetricsAddr string EBPFPollInterval time.Duration NMetricSamples int ShutdownTimeout time.Duration SwaggerApiEnabled bool // XDP Root program details. XDPRootProgramName string XDPRootProgramArtifact string XDPRootProgramMapName string XDPRootProgramCommand string XDPRootProgramVersion string // TC Root program details. TCRootProgramName string TCRootProgramArtifact string TCRootProgramIngressMapName string TCRootProgramEgressMapName string TCRootProgramCommand string TCRootProgramVersion string // ebpf chain details EBPFChainDebugAddr string EBPFChainDebugEnabled bool // l3af configs to listen addrs L3afConfigsRestAPIAddr string // l3af config store L3afConfigStoreFileName string // mTLS MTLSEnabled bool MTLSMinVersion uint16 MTLSCertDir string MTLSCACertFilename string MTLSServerCertFilename string MTLSServerKeyFilename string MTLSCertExpiryWarningDays int MTLSSANMatchRules []string }
func ReadConfig ¶
ReadConfig - Initializes configuration from file