params

package
v0.0.0-...-bea810b Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	String cliParamType = iota
	StringList
	StringOptionsList
	Integer
	Boolean
)

Variables

This section is empty.

Functions

func AddParamMapToCmd

func AddParamMapToCmd(paramMap ParamMap, cmd *cobra.Command, prefix string, hide bool)

func ConvertParamsToConfig

func ConvertParamsToConfig(paramMap ParamMap) map[string]config.Configuration

Types

type CliParam

type CliParam struct {
	Description string
	Default     interface{}
	//this should always be an address to a value - as required by cobra
	Value interface{}
	Type  cliParamType
}

func (CliParam) GetConfigParam

func (c CliParam) GetConfigParam(name string) config.ConfigParam

type ParamMap

type ParamMap map[string]map[string]CliParam

func NewParamMap

func NewParamMap(configs map[string]config.Configuration) ParamMap

type StringOptionsVar

type StringOptionsVar struct {
	Options []string
	Value   string
}

func (*StringOptionsVar) Set

func (o *StringOptionsVar) Set(p string) error

func (StringOptionsVar) String

func (o StringOptionsVar) String() string

func (*StringOptionsVar) Type

func (o *StringOptionsVar) Type() string

type StringSliceOptionsVar

type StringSliceOptionsVar struct {
	Options []string
	Values  []string
}

func (*StringSliceOptionsVar) Set

func (o *StringSliceOptionsVar) Set(val string) error

func (StringSliceOptionsVar) String

func (o StringSliceOptionsVar) String() string

func (*StringSliceOptionsVar) Type

func (o *StringSliceOptionsVar) Type() string

Jump to

Keyboard shortcuts

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