config

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(config *CHYLE, logger *log.Logger)

Debug dumps given CHYLE config as JSON structure

Types

type CHYLE

type CHYLE struct {
	FEATURES struct {
		MATCHERS   matchers.Features
		EXTRACTORS extractors.Features
		DECORATORS decorators.Features
		SENDERS    senders.Features
	} `json:"-"`
	GIT struct {
		REPOSITORY struct {
			PATH string
		}
		REFERENCE struct {
			FROM string
			TO   string
		}
	}
	MATCHERS   matchers.Config
	EXTRACTORS extractors.Config
	DECORATORS decorators.Config
	SENDERS    senders.Config
}

CHYLE hold config extracted from environment variables

func Create

func Create(envConfig *envh.EnvTree) (*CHYLE, error)

Create returns app config from an EnvTree object

func (*CHYLE) Walk

func (c *CHYLE) Walk(fullconfig *envh.EnvTree, keyChain []string) (bool, error)

Walk traverses struct to populate or validate fields

type EnvValidationError added in v1.1.0

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

EnvValidationError is called when validating a configuration failed, it keeps a track of which environment variable is actually tested

func (EnvValidationError) Env added in v1.1.0

func (v EnvValidationError) Env() string

Env returns environment variable currently tested

func (EnvValidationError) Error added in v1.1.0

func (v EnvValidationError) Error() string

Error returns error as string

type MissingEnvError added in v1.1.0

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

MissingEnvError is called when one or several environment variables are missing

func (MissingEnvError) Envs added in v1.1.0

func (e MissingEnvError) Envs() []string

Envs returns environment variables missing

func (MissingEnvError) Error added in v1.1.0

func (e MissingEnvError) Error() string

Errors returns error as string

Jump to

Keyboard shortcuts

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