env

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Env

func Env(kv map[string]string) []byte

func StringifyPath

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

Types

type Decoder

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

func NewDecoder

func NewDecoder(vs *Vars) *Decoder

func (*Decoder) Decode

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

type Encoder

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

func NewEncoder

func NewEncoder(vars *Vars) *Encoder

func (*Encoder) Encode

func (e *Encoder) Encode(v interface{}) ([]byte, error)

func (*Encoder) SecurityEncode

func (e *Encoder) SecurityEncode(v interface{}) ([]byte, error)

type PathWalker

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

func NewPathWalker

func NewPathWalker() *PathWalker

func (*PathWalker) Enter

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

func (*PathWalker) Exit

func (p *PathWalker) Exit()

func (*PathWalker) Paths

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

func (*PathWalker) String

func (p *PathWalker) String() string

type Var

type Var struct {
	Name  string
	Value string
	Mask  string

	Optional      bool
	IsUpstream    bool
	IsCopy        bool
	IsExpose      bool
	IsHealthCheck bool
}

func (*Var) Key

func (v *Var) Key(prefix string) string

func (*Var) SetMeta

func (v *Var) SetMeta(flags map[string]bool)

type Vars

type Vars struct {
	Prefix string
	Values map[string]*Var
}

func LoadVarsFromEnviron

func LoadVarsFromEnviron(prefix string, envs []string) *Vars

func NewVars

func NewVars(prefix string) *Vars

func (*Vars) Bytes

func (vs *Vars) Bytes() []byte

func (*Vars) Get

func (vs *Vars) Get(key string) *Var

func (*Vars) Len

func (vs *Vars) Len(key string) int

func (*Vars) MaskBytes

func (vs *Vars) MaskBytes() []byte

func (*Vars) Set

func (vs *Vars) Set(v *Var)

func (*Vars) SetWithKeyValue

func (vs *Vars) SetWithKeyValue(k, v string)

Jump to

Keyboard shortcuts

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