Documentation ¶
Index ¶
- Constants
- Variables
- func CompileRegex(s string) (*regexp.Regexp, error)
- func ListToMap(a []string) map[string]bool
- func Parse(ptr any, values map[string]int) error
- func ParseChild(parent reflect.Value, v reflect.Value, values map[string]int) error
- func ParseField(v reflect.Value, vField reflect.Value, tField *reflect.StructField, ...) error
- func ParseFieldSelector(selector string) []string
- func ParseSlice(v reflect.Value, values map[string]int) error
- type Base8
- type Config
- type Duration
- type Expression
- type FieldSelector
- type ListMap
- type PipelineConfig
- type Regexp
- type SubstitutionOp
- type SubstitutionOpKind
- type VaultConfig
Constants ¶
Variables ¶
View Source
var DataUnitAliases = map[string]int{ "kb": KB, "kib": KiB, "mb": MB, "mib": MiB, "gb": GB, "gib": GiB, "tb": TB, "tib": TiB, "pb": PB, "pib": PiB, "b": B, }
DataUnitAliases is map to add alias. Alias must not contain space Only lowercase letters should be used in the map, but aliases are case-insensitive
Functions ¶
func ParseChild ¶
it isn't just a recursion it also captures values with the same name from parent i.e. take this config:
{ "T": 10, "Child": { // has `child:true` in a tag "T": null } }
this function will set `config.Child.T = config.T` see file.d/cfg/config_test.go:TestHierarchy for an example
func ParseField ¶
func ParseFieldSelector ¶
Types ¶
type Config ¶
type Config struct { Vault VaultConfig PanicTimeout time.Duration Pipelines map[string]*PipelineConfig }
func NewConfigFromFile ¶
type Expression ¶
type Expression string
func (*Expression) UnmarshalJSON ¶ added in v0.8.9
func (e *Expression) UnmarshalJSON(raw []byte) error
type FieldSelector ¶
type FieldSelector string
type PipelineConfig ¶
type PipelineConfig struct {
Raw *simplejson.Json
}
type SubstitutionOp ¶
type SubstitutionOp struct { Kind SubstitutionOpKind Data []string }
func ParseSubstitution ¶
func ParseSubstitution(substitution string) ([]SubstitutionOp, error)
type SubstitutionOpKind ¶
type SubstitutionOpKind int
const ( SubstitutionOpKindRaw SubstitutionOpKind = iota SubstitutionOpKindField )
type VaultConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.