Documentation ¶
Index ¶
- Constants
- func CloseLogFile(f *os.File)
- func GetNetworkIfname(networkName string) string
- func IsLoggingEnabled() bool
- func LogDebug(format string, args ...interface{})
- func LogError(format string, args ...interface{})
- func LogInfo(format string, args ...interface{})
- func OpenLogFile(params *LoggingParams) *os.File
- type LoggingParams
- type NetworkConfig
Constants ¶
View Source
const ( // LoggingLevelNone for no logging LoggingLevelNone loggingLevelType = iota // LoggingLevelError for error level logging LoggingLevelError // LoggingLevelInfo for info level logging LoggingLevelInfo // LoggingLevelDebug for debug level logging LoggingLevelDebug )
Variables ¶
This section is empty.
Functions ¶
func GetNetworkIfname ¶
GetNetworkIfname from a networkName return a device name by hashing the networkName and prefixing it with auxNetworkIfnamePrefix
func IsLoggingEnabled ¶
func IsLoggingEnabled() bool
IsLoggingEnabled return true if loggingLevelEnvironmentVar is set
func LogDebug ¶
func LogDebug(format string, args ...interface{})
LogDebug debug level logging function
func LogError ¶
func LogError(format string, args ...interface{})
LogError error level logging function
func OpenLogFile ¶
func OpenLogFile(params *LoggingParams) *os.File
OpenLogFile initializes logging
- if loggingLevelEnvironmentVar is not defined or not enabled the log functions would be a nop
- the optioanl params specifies the log file to use and log entries prefix, these can be overwritten via loggingFileEnvironmentVar and loggingPrefixEnvironmentVar env. variables respectively. Note: if a log file has not been specified, logs will be redirected to stderr
Types ¶
type LoggingParams ¶
LoggingParams define logging parameters, File for the log filename and Prefix for log entries prefix
type NetworkConfig ¶
type NetworkConfig struct { NetworkName string `json:"name"` // required parameter: the network name for the CRD network resource in k8s IfMAC string `json:"ifMac,omitempty"` // optional parameter: the network device mac address in the form of 00:11:22:33:44:55 IsPrimary bool `json:"isPrimary,omitempty"` // optional parameter: specify that this network is associated with the primary device in the Pod i.e. eth0 UpperLayers []string `json:"upperLayers,omitempty"` // optional parameter: specify the upper layers for this network i.e. a hierarchy in which this network is a lower layer of another network(s) Namespace string `json:"namespace,omitempty"` // optional parameter: the namespace to which this network belongs to, if not specified it would be the namespace of the pod PodagentSkip bool `json:"podagentSkip,omitempty"` // optional parameter: if true, then podagent won't try to configure this network }
NetworkConfig is a struct of the Pod's annotations networks element (a json array of NetworkConfig)
Click to show internal directories.
Click to hide internal directories.