config

package
v0.0.0-...-cf45389 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvLoader

type EnvLoader interface {
	LookupEnv(string) (string, bool)
}

type Option

type Option struct {
	Name      string           `yaml:"name"`
	Value     string           `yaml:"value"`
	ValueFrom *OptionValueFrom `yaml:"valueFrom"`
}

type OptionLoader

type OptionLoader struct {
	// contains filtered or unexported fields
}

func NewOptionLoader

func NewOptionLoader(options Options) *OptionLoader

func (*OptionLoader) GetInt

func (ol *OptionLoader) GetInt(name string) (int, error)

func (*OptionLoader) GetIntOrDefault

func (ol *OptionLoader) GetIntOrDefault(name string, defaultVal int) (int, error)

func (*OptionLoader) GetString

func (ol *OptionLoader) GetString(name string) (string, error)

func (*OptionLoader) GetStringOrDefault

func (ol *OptionLoader) GetStringOrDefault(name string, defaultVal string) (string, error)

type OptionValueEnvRef

type OptionValueEnvRef struct {
	Key string `yaml:"key"`
}

type OptionValueFrom

type OptionValueFrom struct {
	EnvRef *OptionValueEnvRef `yaml:"envRef"`
}

type Options

type Options []*Option

func (Options) Option

func (o Options) Option(name string) (*Option, bool)

Jump to

Keyboard shortcuts

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