config

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SanitizedValue = "*****"

Variables

This section is empty.

Functions

func DumpToFile added in v1.8.1

func DumpToFile(filename string, cfg Config) error

func FromYAML

func FromYAML(content []byte, cfg Config) error

func Load

func Load(file string, cfg Config) error

func PrintDeprecations added in v1.8.1

func PrintDeprecations(deprecations []Deprecation, cfg Config, out io.Writer)

func ToJson

func ToJson(cfg Config) ([]byte, error)

ToJson converts through YAML, because we only have `yaml` tags on Config. This JSON cannot be parsed by json.Unmarshal because durations are marshaled by yaml to pretty form like "1s". To change it to simple json.Marshal we need to add `json` tag everywhere.

func ToYAML

func ToYAML(cfg Config) ([]byte, error)

Types

type Config

type Config interface {
	Sanitize()
	Validate() error
}

func ConfigForDisplay

func ConfigForDisplay(cfg Config) (Config, error)

type Deprecation added in v1.8.1

type Deprecation struct {
	Env             string
	EnvMsg          string
	ConfigValuePath func(cfg Config) (string, bool)
	ConfigValueMsg  string
}

Jump to

Keyboard shortcuts

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