flags

package
v0.0.0-...-1643d90 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: UPL-1.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultPolicyMgmtEndPoint = "0.0.0.0:6733"
	DefaultAuthzCheckEndPoint = "0.0.0.0:6734"
	DefaultInsecure           = true
	DefaultEnableAuthz        = false

	DefaultStoreType = cfg.StorageTypeFile //file

	DefaultStoreWatchEnabled = true

	EnvVarPrefix = "SPDL"

	DefaultAuditLogLevel      = "info"
	DefaultAuditLogFormatter  = logging.FORMATTER_JSON
	DefaultAuditLogFilename   = ""   // Write audit log to os.Stderr by default
	DefaultAuditLogMaxSize    = "10" // MB
	DefaultAuditLogMaxAge     = "0"  // Never remove old files based on age
	DefaultAuditLogMaxBackups = "5"  // maximum number of old log files to retain

	DefaultAsserterClientTimeout = "5"
)

Variables

This section is empty.

Functions

func FlagToEnv

func FlagToEnv(name string) string

FlagToEnv converts flag string to upper-case environment variable key string.

Types

type AsserterParameters

type AsserterParameters struct {
	AsserterEndpoint       StrParamDetail
	AsserterClientKeyPath  StrParamDetail
	AsserterCaPath         StrParamDetail
	AsserterClientCertPath StrParamDetail
	AsserterClientTimeout  StrParamDetail
}

AsserterParameters asserter webhook configurations

type LogParameters

type LogParameters struct {
	LogLevel        StrParamDetail
	LogFormatter    StrParamDetail
	LogReportCaller StrParamDetail
	LogFileName     StrParamDetail
	LogMaxSize      StrParamDetail
	LogMaxAge       StrParamDetail
	LogMaxBackups   StrParamDetail
	LogLocalTime    StrParamDetail
	LogCompress     StrParamDetail
}

LogParameters is the parameters for log configuration

type Parameters

type Parameters struct {
	////////// Common flags //////////
	Version bool

	//////////Server config//////////////
	ConfigFile      StrParamDetail
	Endpoint        StrParamDetail
	Insecure        StrParamDetail
	EnableAuthz     StrParamDetail
	KeyPath         StrParamDetail
	CertPath        StrParamDetail
	ClientCertPath  StrParamDetail
	ForceClientCert StrParamDetail
	/////////Store config////////////////
	StoreType         StrParamDetail
	StoreWatchEnabled StrParamDetail

	////////Log config/////////////////////
	LogConf      LogParameters // normal log configuration
	AuditLogConf LogParameters // audit log configuration

	// AsserterParameters asserter webhook configuration
	AsserterConf AsserterParameters
}

Parameters is the parameters for Speedle

func (*Parameters) ListenAndServe

func (k *Parameters) ListenAndServe(s *http.Server) error

func (*Parameters) NewHTTPServer

func (k *Parameters) NewHTTPServer(handler http.Handler) (*http.Server, error)

func (*Parameters) Param2Config

func (k *Parameters) Param2Config(storeParamsMap map[string]string) (*cfg.Config, error)

func (*Parameters) ParseFlags

func (k *Parameters) ParseFlags(defaultEndpoint string, printVersionInfoFun func(), storeParamsMap map[string]string)

ParseFlags parses command line arguments

func (*Parameters) ValidateFlags

func (k *Parameters) ValidateFlags()

type StrParamDetail

type StrParamDetail struct {
	Name         string
	ShortName    string
	DefaultValue string
	Usage        string
	Value        string
}

Source Files

  • params.go

Jump to

Keyboard shortcuts

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