env

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotKV           = errors.New("not an env key-value")
	ErrInvalidKVFormat = errors.New("invalid env key-value format")
)

Functions

func Escape

func Escape(key string) string

func Expand

func Expand(value string) string

func Get

func Get(key string) string

func IsSet

func IsSet(key string) bool

func Lookup

func Lookup(key string) (string, bool)

func Or

func Or(key, defaultValue string) string

func ParseKV

func ParseKV(kv string) (string, string, error)

func RawLookup added in v0.1.0

func RawLookup(key string) (string, bool)

func ToKey

func ToKey(key string) string

func Unescape added in v0.1.0

func Unescape(key string) string

Types

type Map

type Map = map[string]string

func Decode

func Decode(r io.Reader) (Map, error)

func Environ

func Environ() Map

func Unmarshal added in v0.1.0

func Unmarshal(data []byte) (Map, error)

func UnmarshalString added in v0.1.0

func UnmarshalString(data string) (Map, error)

type Store

type Store map[string]string

func (Store) Environ

func (s Store) Environ() Map

func (Store) Expand

func (s Store) Expand(value string) string

func (Store) Get

func (s Store) Get(key string) string

func (Store) IsSet

func (s Store) IsSet(key string) bool

func (Store) Lookup

func (s Store) Lookup(key string) (string, bool)

func (Store) Or

func (s Store) Or(key, defaultValue string) string

func (Store) RawLookup added in v0.1.0

func (s Store) RawLookup(key string) (string, bool)

Jump to

Keyboard shortcuts

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