Documentation
¶
Index ¶
- type Environ
- func (e *Environ) IsSet(key string) bool
- func (e *Environ) Load(s store.Store, service string, collisions *[]string) error
- func (e *Environ) LoadNoPaths(s store.Store, service string, collisions *[]string) error
- func (e *Environ) LoadStrict(s store.Store, valueExpected string, pristine bool, services ...string) error
- func (e *Environ) LoadStrictNoPaths(s store.Store, valueExpected string, pristine bool, services ...string) error
- func (e *Environ) Map() map[string]string
- func (e *Environ) Set(key, val string)
- func (e *Environ) Unset(key string)
- type ErrExpectedKeyUnnormalized
- type ErrStoreMissingKey
- type ErrStoreUnexpectedValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environ ¶
type Environ []string
environ is a slice of strings representing the environment, in the form "key=value".
func (*Environ) Load ¶
Load loads environment variables into e from s given a service collisions will be populated with any keys that get overwritten
func (*Environ) LoadNoPaths ¶
LoadNoPaths is identical to Load, but uses v1-style "."-separated paths
Deprecated like all noPaths functionality
func (*Environ) LoadStrict ¶
func (e *Environ) LoadStrict(s store.Store, valueExpected string, pristine bool, services ...string) error
LoadStrict loads all services from s in strict mode: env vars in e with value equal to valueExpected are the only ones substituted. If there are any env vars in s that are also in e, but don't have their value set to valueExpected, this is an error.
func (*Environ) LoadStrictNoPaths ¶
func (e *Environ) LoadStrictNoPaths(s store.Store, valueExpected string, pristine bool, services ...string) error
LoadNoPathsStrict is identical to LoadStrict, but uses v1-style "."-separated paths
Deprecated like all noPaths functionality
func (*Environ) Map ¶
Map squashes the list-like environ, taking the latter value when there are collisions, like a shell would. Invalid items (e.g., missing `=`) are dropped
type ErrExpectedKeyUnnormalized ¶
func (ErrExpectedKeyUnnormalized) Error ¶
func (e ErrExpectedKeyUnnormalized) Error() string
type ErrStoreMissingKey ¶
func (ErrStoreMissingKey) Error ¶
func (e ErrStoreMissingKey) Error() string
type ErrStoreUnexpectedValue ¶
type ErrStoreUnexpectedValue struct { // store-style key Key string ValueExpected string ValueActual string }
func (ErrStoreUnexpectedValue) Error ¶
func (e ErrStoreUnexpectedValue) Error() string