configuration

package
v2.48.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2021 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ProductName = "trireme-example"

ProductName is used in cobra/viper

View Source
const TriremeEnvPrefix = "TRIREME_EXAMPLE"

TriremeEnvPrefix is the prefix used to provide configuration through env variables.

View Source
const Usage = `` /* 746-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 AuthType

type AuthType int

AuthType is a type that holds an Authentication method

const (
	// PSK is the Authentication method that relies on a preshared Key (unsecure)
	PSK AuthType = iota + 1
	// PKI is the Authentication methid that relies on a PKI
	PKI
)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL