flags

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0, EPL-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrParse is generic flags parse error
	ErrParse = errors.New("cannot parse flags")
)

Functions

func Add

func Add(f *flag.FlagSet, settings *config.Settings)

Add adds the Suite Connector flags and uses the provided settings to collect the provided values.

func AddGlobal

func AddGlobal(f *flag.FlagSet) (configFile *string)

AddGlobal adds the Suite Connector global flags.

func AddHub

func AddHub(f *flag.FlagSet, settings, def *config.HubConnectionSettings)

AddHub adds the Hub connection related flags.

func AddLocalBroker

func AddLocalBroker(f *flag.FlagSet, settings, def *config.LocalConnectionSettings)

AddLocalBroker add the local connection related flags.

func AddLog

func AddLog(f *flag.FlagSet, settings, def *logger.LogSettings)

AddLog adds the Logger related flags.

func AddTLS

func AddTLS(f *flag.FlagSet, settings, def *config.TLSSettings)

AddTLS add the TLS connection related flags.

func ConfigCheck

func ConfigCheck(logger logger.Logger, configFile string)

ConfigCheck checks for config file existence.

func Copy

func Copy(f *flag.FlagSet) map[string]interface{}

Copy configured all set flag values to map

func Parse

func Parse(f *flag.FlagSet, args []string, version string, exit func(code int)) error

Parse invokes flagset parse and processes the version

Types

type LogLevelV

type LogLevelV struct {
	// contains filtered or unexported fields
}

LogLevelV represents LogLevel flag value.

func NewLogLevelV

func NewLogLevelV(setter *logger.LogLevel, defaultVal logger.LogLevel) *LogLevelV

NewLogLevelV creates new flag variable for LogLevel definition.

func (*LogLevelV) Get

func (f *LogLevelV) Get() interface{}

Get returns the flag converted value.

func (*LogLevelV) Provided

func (f *LogLevelV) Provided() bool

Provided returns true if the flag value is provided.

func (*LogLevelV) Set

func (f *LogLevelV) Set(value string) error

Set validates and applies the provided value if no error.

func (*LogLevelV) String

func (f *LogLevelV) String() string

String returns the flag string value.

type StringSliceV

type StringSliceV struct {
	// contains filtered or unexported fields
}

StringSliceV represents slice of strings flag value.

func NewStringSliceV

func NewStringSliceV(setter *[]string) *StringSliceV

NewStringSliceV creates new flag variable for slice of strings definition.

func (*StringSliceV) Get

func (f *StringSliceV) Get() interface{}

Get returns the flag converted value.

func (*StringSliceV) Provided

func (f *StringSliceV) Provided() bool

Provided returns true if the flag value is provided.

func (*StringSliceV) Set

func (f *StringSliceV) Set(value string) error

Set validates and applies the provided value if no error.

func (*StringSliceV) String

func (f *StringSliceV) String() string

String returns the flag string value.

type URLV

type URLV struct {
	// contains filtered or unexported fields
}

URLV represents URL flag value.

func NewURLV

func NewURLV(setter *string, defaultVal string) *URLV

NewURLV creates new flag variable for URL definition.

func (*URLV) Get

func (f *URLV) Get() interface{}

Get returns the flag converted value.

func (*URLV) Provided

func (f *URLV) Provided() bool

Provided returns true if the flag value is provided.

func (*URLV) Set

func (f *URLV) Set(value string) error

Set validates and applies the provided value if no error.

func (*URLV) String

func (f *URLV) String() string

String returns the flag string value.

Jump to

Keyboard shortcuts

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