configutil

package
v0.26.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SetDefault

type SetDefault interface {
	SetDefault(key string, value any)
}

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

type SetDefaultFunc func(key string, value any)

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

Jump to

Keyboard shortcuts

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