Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoValue = errors.New("no value found for option") ErrWrongType = errors.New("wrong type for option") )
Functions ¶
func GetAny ¶ added in v0.1.7
func GetAny[T any](ol OptionsList, key string) (T, error)
GetAny retrieves the first matching value from a given OptionsList and returns ErrNoValue if nothing could be found.
func GetOptional ¶
GetOptional retrieves a value by a given key. It returns the zero value of T if the key could not be found.
Types ¶
type OptionsList ¶ added in v0.1.7
type OptionsList []Options
Click to show internal directories.
Click to hide internal directories.