config

package
v0.0.0-...-4351fdd Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(conf map[string]interface{}, target interface{}) error

Decode converts a configuration map into the desired target type Decode errors on unused keys

func PartialDecode

func PartialDecode(conf map[string]interface{}, target interface{}) error

PartialDecode converts a configuration map into the desired target type. PartialDecode does not error on unused keys

Types

type Action

type Action struct {
	Entity `yaml:",squash"`
}

func (*Action) String

func (a *Action) String() string

String implements Stringer for debugging

type Config

type Config struct {
	Sources  []Generic `yaml:"sources"`
	Targets  []Generic `yaml:"targets"`
	Wires    []Wire    `yaml:"wires"`
	Mappings []Mapping `yaml:"mappings"`
	Actions  []Generic `yaml:"actions"`
}

func (*Config) Dump

func (c *Config) Dump()

Dump dumps parsed config to console

type Credentials

type Credentials struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

type Entity

type Entity struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"`
}

type Generic

type Generic map[string]interface{}

type MapEntry

type MapEntry struct {
	From string
	To   string
}

type Mapping

type Mapping struct {
	Name    string     `yaml:"name"`
	Entries []MapEntry `yaml:"entries"`
}

type Source

type Source struct {
	Entity      `yaml:",squash"`
	Credentials `yaml:",squash"`
}

type Target

type Target struct {
	Entity      `yaml:",squash"`
	Credentials `yaml:",squash"`
}

type Wire

type Wire struct {
	Source  string   `yaml:"source"`
	Target  string   `yaml:"target"`
	Actions []string `yaml:"actions"`
}

Jump to

Keyboard shortcuts

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