env

package
v0.0.0-...-4845449 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "KBC_"

Variables

This section is empty.

Functions

func Files

func Files() []string

Types

type Map

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

Map - abstraction for ENV variables. Keys are represented as uppercase string.

func Empty

func Empty() *Map

func FromMap

func FromMap(data map[string]string) *Map

func FromOs

func FromOs() (*Map, error)

func (*Map) Clear

func (m *Map) Clear()

func (*Map) Get

func (m *Map) Get(key string) string

func (*Map) Keys

func (m *Map) Keys() []string

func (*Map) Lookup

func (m *Map) Lookup(key string) (string, bool)

func (*Map) Merge

func (m *Map) Merge(data *Map, overwrite bool)

Merge keys from an env.Map.

func (*Map) MustGet

func (m *Map) MustGet(key string) string

func (*Map) Set

func (m *Map) Set(key, value string)

func (*Map) ToMap

func (m *Map) ToMap() map[string]string

func (*Map) ToSlice

func (m *Map) ToSlice() []string

func (*Map) ToString

func (m *Map) ToString() (string, error)

func (*Map) Unset

func (m *Map) Unset(key string)

type NamingConvention

type NamingConvention struct{}

func NewNamingConvention

func NewNamingConvention() *NamingConvention

func (*NamingConvention) Replace

func (*NamingConvention) Replace(flagName string) string

Replace converts flag name to ENV variable name for example "storage-api-host" -> "KBC_STORAGE_API_HOST".

Jump to

Keyboard shortcuts

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