Documentation ¶
Index ¶
- func Get(src any, path string) (any, error)
- func GetBool(data any, path string, defaults ...bool) bool
- func GetFloat64(data any, path string, defaults ...float64) float64
- func GetInt(data any, path string, defaults ...int) int
- func GetList(data any, path string, defaults ...[]any) []any
- func GetListString(data any, path string, defaults ...[]string) []string
- func GetMap(data any, path string, defaults ...map[string]any) map[string]any
- func GetString(data any, path string, defaults ...string) string
- func ToListString(in []any) []string
- type YAML
- func (y *YAML) Bool(path string, defaults ...bool) bool
- func (y *YAML) Data() any
- func (y *YAML) Float64(path string, defaults ...float64) float64
- func (y *YAML) Get(path string) (*YAML, error)
- func (y *YAML) Int(path string, defaults ...int) int
- func (y *YAML) List(path string, defaults ...[]any) []any
- func (y *YAML) ListString(path string, defaults ...[]string) []string
- func (y *YAML) Map(path string, defaults ...map[string]any) map[string]any
- func (y *YAML) String(path string, defaults ...string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns a child of the given value according to a dotted path. The source data must be either map[string]any or []any
func GetFloat64 ¶
Float64 returns a float64 according to a dotted path or default value or 0.
func GetListString ¶
ListString is for the very common case of a list of strings
func ToListString ¶
Types ¶
type YAML ¶
type YAML struct {
// contains filtered or unexported fields
}
YAML represents a complex internal YAML structure with convenient access methods, using dotted path syntax
func ParseJsonFile ¶
ParseJsonFile reads a JSON configuration from the given filename.
func ParseYamlBytes ¶
ParseYamlBytes reads a YAML configuration from the given []byte.
func ParseYamlFile ¶
ParseYamlFile reads a YAML configuration from the given filename.
func (*YAML) ListString ¶
ListString is for the very common case of a list of strings
Click to show internal directories.
Click to hide internal directories.