goenv

package module
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: MIT Imports: 8 Imported by: 0

README

goenv Build Status codecov

Golang library for managing configuration data from environment variables -- Just do simple things well.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigurationMustBeAStructPointer error = errors.New("configuration must be a struct pointer")
)

Functions

func ImplementsBinaryUnmarshaler

func ImplementsBinaryUnmarshaler(relectType reflect.Type) bool

func ImplementsDecoder

func ImplementsDecoder(relectType reflect.Type) bool

func ImplementsSetter

func ImplementsSetter(relectType reflect.Type) bool

func ImplementsTextUnmarshaler

func ImplementsTextUnmarshaler(relectType reflect.Type) bool

func NewErrRequiredEnvKeyForField

func NewErrRequiredEnvKeyForField(envKey, fieldTypeName string) error

func Unmarshal

func Unmarshal(config interface{}) error

Types

type Decoder

type Decoder interface {
	Decode(value string) error
}

Decoder has the same semantics as Setter, but takes higher precedence. It is provided for historical compatibility.

type ErrRequiredEnvKeyForField

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

func (*ErrRequiredEnvKeyForField) Error

func (e *ErrRequiredEnvKeyForField) Error() string

type Setter

type Setter interface {
	Set(value string) error
}

Setter is implemented by types can self-deserialize values. Any type that implements flag.Value also implements Setter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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