Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GracePeriod time.Duration

Functions

func RegisterExtension

func RegisterExtension(e Extension)

func WithConfig

func WithConfig(ctx context.Context, config *Config) context.Context

Types

type ArbitraryOption

type ArbitraryOption struct {
	Name        string
	Description string
	Default     interface{}
	Type        reflect.Type
	FlagSet     *pflag.FlagSet
}

func (*ArbitraryOption) AddToCommand

func (this *ArbitraryOption) AddToCommand(cmd *cobra.Command)

func (*ArbitraryOption) BoolValue

func (this *ArbitraryOption) BoolValue() bool

func (*ArbitraryOption) Changed

func (this *ArbitraryOption) Changed() bool

func (*ArbitraryOption) DurationValue

func (this *ArbitraryOption) DurationValue() time.Duration

func (*ArbitraryOption) IntValue

func (this *ArbitraryOption) IntValue() int

func (*ArbitraryOption) StringArray

func (this *ArbitraryOption) StringArray() []string

func (*ArbitraryOption) StringValue

func (this *ArbitraryOption) StringValue() string

type Config

type Config struct {
	LogLevel                    string
	Controllers                 string
	PluginDir                   string
	Name                        string
	Namespace                   string
	OmitLease                   bool
	DisableNamespaceRestriction bool
	NamespaceRestriction        bool
	ServerPortHTTP              int
	CPUProfile                  string
	ArbitraryOptions            map[string]*ArbitraryOption
	// contains filtered or unexported fields
}

func Get

func Get(ctx context.Context) *Config

func NewConfig

func NewConfig() *Config

func (*Config) AddBoolOption

func (this *Config) AddBoolOption(name string) (*ArbitraryOption, bool)

func (*Config) AddDurationOption

func (this *Config) AddDurationOption(name string) (*ArbitraryOption, bool)

func (*Config) AddIntOption

func (this *Config) AddIntOption(name string) (*ArbitraryOption, bool)

func (*Config) AddOption

func (this *Config) AddOption(name string, t reflect.Type) (*ArbitraryOption, bool)

func (*Config) AddStringArrayOption

func (this *Config) AddStringArrayOption(name string) (*ArbitraryOption, bool)

func (*Config) AddStringOption

func (this *Config) AddStringOption(name string) (*ArbitraryOption, bool)

func (*Config) AddToCommand

func (this *Config) AddToCommand(cmd *cobra.Command)

func (*Config) GetOption

func (this *Config) GetOption(name string) *ArbitraryOption

type Extension

type Extension func(cfg *Config)

Jump to

Keyboard shortcuts

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