cfg

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version  string             `yaml:"version"`
	Features map[string]Feature `yaml:"features"`
}

func LoadYAML

func LoadYAML(r io.Reader) (Config, error)

func LoadYAMLDir

func LoadYAMLDir(filePath string) (Config, error)

func (*Config) Append

func (c *Config) Append(a Config)

type DisableRule added in v0.1.0

type DisableRule struct {
	Field  string   `yaml:"field"`
	Fields []string `yaml:"fields"`

	Values MatchValues `yaml:"values"`
}

type EnableRule added in v0.1.0

type EnableRule struct {
	Field  string   `yaml:"field"`
	Fields []string `yaml:"fields"`

	Values MatchValues `yaml:"values"`
	Weight int         `yaml:"weight"`
}

type Feature

type Feature struct {
	Rules Rules `yaml:"rules"`
}

type MatchValues added in v0.1.0

type MatchValues struct {
	Eq []string `json:"eq"`
}

type Rules added in v0.1.0

type Rules struct {
	Enable  []EnableRule  `yaml:"enable"`
	Disable []DisableRule `yaml:"disable"`
	SetVars []SetVarRule  `yaml:"set_vars"`
}

type SetVarRule added in v0.1.0

type SetVarRule struct {
	Field  string   `yaml:"field"`
	Fields []string `yaml:"fields"`

	Values MatchValues `yaml:"values"`
	Weight int         `yaml:"weight"`

	Set map[string]interface{} `json:"set"`
}

Jump to

Keyboard shortcuts

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