Documentation ¶
Index ¶
Constants ¶
const ProductName = "trireme-example"
ProductName is used in cobra/viper
const TriremeEnvPrefix = "TRIREME"
TriremeEnvPrefix is the prefix used to provide configuration through env variables.
const Usage = `` /* 778-byte string literal not displayed */
Usage is the whole help string for the executable
Variables ¶
This section is empty.
Functions ¶
func InitCLI ¶
func InitCLI(runFunc, rmFunc, cgroupFunc, enforceFunc, daemonFunc func(*Configuration) error, setLogs func(logFormat, logLevel string) error, banner func()) *cobra.Command
InitCLI processes all commands and option flags, loads the configuration and prepares the CLI for execution. It returns the cobra instance which you should execute once ready to run the program. The arguments are the functions that should get executed once the CLI is started. `setLogs` is called to prepare zap. `banner` is called to print a CLI banner on daemon startup.
Types ¶
type Configuration ¶
type Configuration struct { // Arguments is the retrocompatible format used to define the parameters//process to run Arguments map[string]interface{} // AuthType defines if Trireme uses PSK or PKI Auth AuthType // PSK is the PSK used for Trireme (if using PSK) PSK string // Set of Policies to be used with this example. PolicyFile string // Launch Trireme-Example with support for CustomExtractor CustomExtractor string // KeyPath is the path to the Key in PEM encoded format KeyPath string // CertPath is the path to the Cert in PEM encoded format CertPath string // CaCertPath is the path to the CaCert in PEM encoded format CaCertPath string // CaKeyPath is the path to the CaKey in PEM encoded format CaKeyPath string TriremeNetworks string ParsedTriremeNetworks []string LogFormat string LogLevel string // RemoteEnforcer defines if the enforcer is spawned into each POD namespace // or into the host default namespace. RemoteEnforcer bool DockerEnforcement bool // LinuxProcesses defines if we activate//police LinuxProcesses LinuxProcessesEnforcement bool // Launch Trireme-Example with support for Swarm SwarmMode bool // Enforce defines if this process is an enforcer process (spawned into POD namespaces) Enforce bool `mapstructure:"Enforce"` // Run defines if this process is used to run a command Run bool }
Configuration holds the whole configuration for Trireme-Example
func (*Configuration) Fields ¶
func (c *Configuration) Fields() []zapcore.Field
Fields returns a ready to dump zap.Fields containing all the configuration used.