config

package
v0.0.0-...-932f233 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func CanoncalGroup

func CanoncalGroup(group string) string

func DumpToFile

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 LoadWithOption

func LoadWithOption(file string, cfg Config, strict bool, includeEnv bool, validate bool) error

func MarshalIndent

func MarshalIndent(msg proto.Message, indent string) ([]byte, error)

func PrintDeprecations

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

func ToJSON

func ToJSON(s Spec) ([]byte, error)

func ToJSONWithIndent

func ToJSONWithIndent(msg proto.Message, indent string) (string, error)

func ToJSONWithOptions

func ToJSONWithOptions(msg proto.Message, indent string, enumsAsInts bool) (string, error)

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 BaseConfig

type BaseConfig struct{}

func (BaseConfig) PostProcess

func (c BaseConfig) PostProcess() error

func (BaseConfig) Sanitize

func (c BaseConfig) Sanitize()

func (BaseConfig) Validate

func (c BaseConfig) Validate() error

type Config

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

func ConfigForDisplay

func ConfigForDisplay(cfg Config) (Config, error)

type Deprecation

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

type GroupVersionKind

type GroupVersionKind struct {
	Group   string `json:"group"`
	Version string `json:"version"`
	Kind    string `json:"kind"`
}

func (GroupVersionKind) CanonicalGroup

func (g GroupVersionKind) CanonicalGroup() string

func (GroupVersionKind) String

func (g GroupVersionKind) String() string

type Spec

type Spec any

Jump to

Keyboard shortcuts

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