params

package
v1.5.0-rc.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagErr

func FlagErr(flagName, format string, a ...any) error

func GetParamByName

func GetParamByName(paramName, paramsStr string) (string, error)

func Map

func Map(flagName, paramsStr string, obj interface{}) error

Map assigns the parameter value into the right struct field, which is represented by obj. For example, if we use Map("param1", "value1", &myFlag) with MyFlag struct above, Param1 field would be assigned with "value1". Note that this function may modify the passed in object, even if an error is returned. The reason for this is that we don't know the type of the passed in object and if there is a copy function for it. It is up to the caller to create a copy of the passed in object if required.

func SplitPrefixedName

func SplitPrefixedName(prefixedName string) (string, string, error)

SplitPrefixedName splits prefixedName with "/" as a separator

func Supported

func Supported(obj interface{}) string

Supported returns the list of supported flags for a parameter struct. This is mainly used to show the user the list of supported parameters

Types

type NotFoundError added in v1.2.0

type NotFoundError struct {
	Name string
}

func (NotFoundError) Error added in v1.2.0

func (e NotFoundError) Error() string

func (NotFoundError) Is added in v1.2.0

func (e NotFoundError) Is(target error) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳