v0.0.0-...-1643d90 Latest Latest

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




View Source
const (
	DefaultPolicyMgmtEndPoint = ""
	DefaultAuthzCheckEndPoint = ""
	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"


This section is empty.


func FlagToEnv

func FlagToEnv(name string) string

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


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

Jump to

Keyboard shortcuts

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