config

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2021 License: MPL-2.0 Imports: 6 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 {
	Providers []Provider
}

func LoadFromString

func LoadFromString(data string) (*Config, error)

Load Config data from string input

func Parse

func Parse(configPath string) (*Config, error)

func (*Config) ProviderExists

func (c *Config) ProviderExists(providerName string) bool

Check if provider already exists in configuration file

func (*Config) UnmarshalJSON added in v0.11.5

func (c *Config) UnmarshalJSON(data []byte) error

Default JSON unmarshaler will not populate the Rest field and there are no type annotations that make this happen. See https://github.com/golang/go/issues/6213

Function assumes config keys are lowercase

type Provider

type Provider struct {
	Name    string
	Version string                 `default:"latest"`
	Rest    map[string]interface{} `yaml:",inline"`
}

func (*Provider) UnmarshalYAML

func (p *Provider) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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