envconf

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 12 Imported by: 0

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

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

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

openapi:strfmt endpoint

func ParseEndpoint

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

func (Endpoint) Host

func (e Endpoint) Host() string

func (*Endpoint) IsTLS

func (e *Endpoint) IsTLS() bool

func (Endpoint) IsZero

func (e Endpoint) IsZero() bool

func (Endpoint) MarshalText

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

func (Endpoint) SecurityString

func (e Endpoint) SecurityString() string

func (Endpoint) String

func (e Endpoint) String() string

func (*Endpoint) UnmarshalText

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

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