envconf

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 12 Imported by: 11

README

EnvConf

GoDoc Widget codecov Go Report Card

Configuration generator and loader through environment variables

Rules

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DotEnv

func DotEnv(keyValues map[string]string) []byte

func StringifyPath

func StringifyPath(paths ...interface{}) string

func UnmarshalExtra added in v1.3.0

func UnmarshalExtra(extra url.Values, v interface{}) error

Types

type DotEnvDecoder

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

func NewDotEnvDecoder

func NewDotEnvDecoder(envVars *EnvVars) *DotEnvDecoder

func (*DotEnvDecoder) Decode

func (d *DotEnvDecoder) Decode(v interface{}) error

type DotEnvEncoder

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

func NewDotEnvEncoder

func NewDotEnvEncoder(envVars *EnvVars) *DotEnvEncoder

func (*DotEnvEncoder) Encode

func (d *DotEnvEncoder) Encode(v interface{}) ([]byte, error)

func (*DotEnvEncoder) SecurityEncode

func (d *DotEnvEncoder) SecurityEncode(v interface{}) ([]byte, error)

type Duration

type Duration time.Duration

func (Duration) MarshalText

func (d Duration) MarshalText() (text []byte, err error)

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type Endpoint added in v1.3.0

type Endpoint struct {
	Scheme   string
	Hostname string
	Port     uint16
	Base     string
	Username string
	Password string
	Extra    url.Values
}

openapi:strfmt endpoint

func ParseEndpoint added in v1.3.0

func ParseEndpoint(text string) (*Endpoint, error)

func (Endpoint) Host added in v1.3.0

func (e Endpoint) Host() string

func (*Endpoint) IsTLS added in v1.3.0

func (e *Endpoint) IsTLS() bool

func (Endpoint) IsZero added in v1.3.0

func (e Endpoint) IsZero() bool

func (Endpoint) MarshalText added in v1.3.0

func (e Endpoint) MarshalText() (text []byte, err error)

func (Endpoint) SecurityString added in v1.3.0

func (e Endpoint) SecurityString() string

func (Endpoint) String added in v1.3.0

func (e Endpoint) String() string

func (*Endpoint) UnmarshalText added in v1.3.0

func (e *Endpoint) UnmarshalText(text []byte) error

type EnvVar

type EnvVar struct {
	KeyPath string
	Value   string
	Mask    string

	Optional      bool
	IsUpstream    bool
	IsCopy        bool
	IsExpose      bool
	IsHealthCheck bool
}

func (*EnvVar) Key

func (envVar *EnvVar) Key(prefix string) string

type EnvVars

type EnvVars struct {
	Prefix string
	Values map[string]*EnvVar
}

func EnvVarsFromEnviron

func EnvVarsFromEnviron(prefix string, envs []string) *EnvVars

func NewEnvVars

func NewEnvVars(prefix string) *EnvVars

func (*EnvVars) Bytes

func (e *EnvVars) Bytes() []byte

func (*EnvVars) Get

func (e *EnvVars) Get(key string) *EnvVar

func (*EnvVars) Len

func (e *EnvVars) Len(key string) int

func (*EnvVars) MaskBytes

func (e *EnvVars) MaskBytes() []byte

func (*EnvVars) Set

func (e *EnvVars) Set(envVar *EnvVar)

func (*EnvVars) SetKeyValue added in v1.1.0

func (e *EnvVars) SetKeyValue(k string, v string)

type Password

type Password string

func (Password) SecurityString

func (p Password) SecurityString() string

func (Password) String

func (p Password) String() string

type PathWalker

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

func NewPathWalker

func NewPathWalker() *PathWalker

func (*PathWalker) Enter

func (pw *PathWalker) Enter(i interface{})

func (*PathWalker) Exit

func (pw *PathWalker) Exit()

func (*PathWalker) Paths

func (pw *PathWalker) Paths() []interface{}

func (*PathWalker) String

func (pw *PathWalker) String() string

type SecurityStringer

type SecurityStringer interface {
	SecurityString() string
}

mask value string for security value

Jump to

Keyboard shortcuts

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