Documentation
¶
Index ¶
- Constants
- func GetBoolValue(dataValue, dataName string) (result bool, err error)
- func GetK8sAPILogger() *logger
- func GetLogger() *logger
- func HomeDir() string
- func ParseTime(data string) (*int64, error)
- func PtrInt64(value int64) *int64
- func PtrString(value string) *string
- func RandomString(n int) string
- type LogLevel
- type LogLevelValue
- type Logger
- type NamespaceValue
- type OSArgs
Constants ¶
View Source
const ( LogTypeShort = log.LstdFlags LogType = log.LstdFlags | log.Lshortfile )
Variables ¶
This section is empty.
Functions ¶
func GetBoolValue ¶
func GetK8sAPILogger ¶ added in v1.4.4
func GetK8sAPILogger() *logger
Types ¶
type LogLevelValue ¶ added in v1.4.4
type LogLevelValue struct {
LogLevel LogLevel
}
LogLevel used to automatically distinct namespace/name string
func (*LogLevelValue) UnmarshalFlag ¶ added in v1.4.4
func (n *LogLevelValue) UnmarshalFlag(value string) error
UnmarshalFlag Unmarshal flag
type Logger ¶ added in v1.4.4
type Logger interface {
Print(args ...interface{}) // always print regardles of Log level
Trace(args ...interface{}) // used for heavy duty output everything, not recommended for production
Debug(args ...interface{}) // used to have detailed output of application flow
Info(args ...interface{})
Warning(args ...interface{})
Error(args ...interface{})
Err(args ...interface{}) []error
Panic(args ...interface{})
Printf(format string, args ...interface{}) // similar to fmt.SPrintf function
Tracef(format string, args ...interface{}) // similar to fmt.SPrintf function
Debugf(format string, args ...interface{}) // similar to fmt.SPrintf function
Infof(format string, args ...interface{}) // similar to fmt.SPrintf function
Warningf(format string, args ...interface{}) // similar to fmt.SPrintf function
Errorf(format string, args ...interface{}) // similar to fmt.SPrintf function
Panicf(format string, args ...interface{}) // similar to fmt.SPrintf function
SetLevel(level LogLevel)
ShowFilename(show bool)
}
Logger provides functions to writing log messages level can be defined only as `trace`, `debug`, `info`, `warning`, `error` error and panic are always printed, panic also exits application.
if nil is sent, it won't be printed. This is usefull for printing errors only if they exist. ```
if err != nil {
logger.Error(err)
}
``` can be shortened to ``` logger.Error(err) ```
type NamespaceValue ¶
type NamespaceValue struct {
Namespace, Name string
}
NamespaceValue used to automatically distinct namespace/name string
func (NamespaceValue) MarshalFlag ¶
func (n NamespaceValue) MarshalFlag() (string, error)
MarshalFlag Marshals flag
func (*NamespaceValue) UnmarshalFlag ¶
func (n *NamespaceValue) UnmarshalFlag(value string) error
UnmarshalFlag Unmarshal flag
type OSArgs ¶
type OSArgs struct {
Version []bool `short:"v" long:"version" description:"version"`
DefaultBackendService NamespaceValue `` /* 131-byte string literal not displayed */
DefaultCertificate NamespaceValue `long:"default-ssl-certificate" default:"" description:"secret name of the certificate"`
ConfigMap NamespaceValue `long:"configmap" description:"configmap designated for HAProxy" default:""`
ConfigMapTCPServices NamespaceValue `long:"configmap-tcp-services" description:"configmap used to define tcp services" default:""`
KubeConfig string `long:"kubeconfig" default:"" description:"combined with -e. location of kube config file"`
NamespaceWhitelist []string `long:"namespace-whitelist" description:"whitelisted namespaces"`
NamespaceBlacklist []string `long:"namespace-blacklist" description:"blacklisted namespaces"`
OutOfCluster bool `short:"e" description:"use as out of cluster controller NOTE: experimental"`
Test bool `short:"t" description:"simulate running HAProxy"`
Help []bool `short:"h" long:"help" description:"show this help message"`
IngressClass string `long:"ingress.class" default:"" description:"ingress.class to monitor in multiple controllers environment"`
PublishService string `` /* 205-byte string literal not displayed */
SyncPeriod time.Duration `` /* 133-byte string literal not displayed */
LogLevel LogLevelValue `long:"log" default:"info" description:"level of log messages you can see"`
}
OSArgs contains arguments that can be sent to controller
Click to show internal directories.
Click to hide internal directories.