Documentation ¶
Index ¶
- type SetDefault
- type SetDefaultFunc
- type SingleOrMulti
- func (a SingleOrMulti[T]) IsMulti() bool
- func (a SingleOrMulti[T]) MarshalJSON() ([]byte, error)
- func (a SingleOrMulti[T]) MarshalYAML() (any, error)
- func (a SingleOrMulti[T]) Multi() []T
- func (a SingleOrMulti[T]) Random() T
- func (a SingleOrMulti[T]) Single() T
- func (a SingleOrMulti[T]) String() string
- func (a *SingleOrMulti[T]) UnmarshalJSON(bytes []byte) error
- func (a *SingleOrMulti[T]) UnmarshalYAML(value *yaml.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetDefault ¶
SetDefault is an interface to abstract setting Viper defaults. (e.g. Allows adding a key prefix to every call to SetDefault when used with SetDefaultFunc.)
type SetDefaultFunc ¶
SetDefaultFunc implements SetDefault.
func (SetDefaultFunc) SetDefault ¶
func (f SetDefaultFunc) SetDefault(key string, value any)
See SetDefault interface.
type SingleOrMulti ¶ added in v0.24.0
type SingleOrMulti[T any] []T
SingleOrMulti is a type that can be either a single value or a slice of values.
func (SingleOrMulti[T]) IsMulti ¶ added in v0.24.0
func (a SingleOrMulti[T]) IsMulti() bool
func (SingleOrMulti[T]) MarshalJSON ¶ added in v0.24.0
func (a SingleOrMulti[T]) MarshalJSON() ([]byte, error)
func (SingleOrMulti[T]) MarshalYAML ¶ added in v0.24.0
func (a SingleOrMulti[T]) MarshalYAML() (any, error)
func (SingleOrMulti[T]) Multi ¶ added in v0.24.0
func (a SingleOrMulti[T]) Multi() []T
func (SingleOrMulti[T]) Random ¶ added in v0.24.0
func (a SingleOrMulti[T]) Random() T
func (SingleOrMulti[T]) Single ¶ added in v0.24.0
func (a SingleOrMulti[T]) Single() T
func (SingleOrMulti[T]) String ¶ added in v0.24.0
func (a SingleOrMulti[T]) String() string
func (*SingleOrMulti[T]) UnmarshalJSON ¶ added in v0.24.0
func (a *SingleOrMulti[T]) UnmarshalJSON(bytes []byte) error
func (*SingleOrMulti[T]) UnmarshalYAML ¶ added in v0.24.0
func (a *SingleOrMulti[T]) UnmarshalYAML(value *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.