env

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 9 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 ToKey

func ToKey(key string) string

Types

type Map

type Map = map[string]string

func Decode

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

func DecodeBytes

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

func DecodeString

func DecodeString(data string) (Map, error)

func Environ

func Environ() Map

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

Jump to

Keyboard shortcuts

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