env

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2018 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyAttributeError added in v0.2.0

func EmptyAttributeError(attr string) error

EmptyAttributeError is for when a required attribute is empty.

func ParseSplitError added in v0.2.0

func ParseSplitError(env string) error

ParseSplitError is for when failing to parse a env-line.

Types

type Config added in v0.2.0

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

Config contains the given "path", "extn" and "body" of a config, as well as the parsed config --> KV map.

func New

func New() *Config

New object.

func (*Config) Body added in v0.2.0

func (s *Config) Body() Envs

Body returns s.path as a key, for use by the configs package.

func (*Config) FromOsEnviron added in v0.2.0

func (s *Config) FromOsEnviron() *Config

FromOsEnviron sets s.env to the current os.Environ.

func (*Config) Key added in v0.2.0

func (s *Config) Key() string

Key returns a sort key, for use by the configs package. This makes little sense for os.Environ, so we always return "".

func (*Config) SetBodyMap added in v0.2.0

func (s *Config) SetBodyMap(env common.BodyMap) *Config

SetBodyMap creates a new env.Configs object, with the contents of a Maps object added to its EnvMaps.

func (*Config) SetEnv added in v0.2.0

func (s *Config) SetEnv(env Envs) *Config

SetEnv sets s.env struct, with the given env.

func (*Config) ToBodyMap added in v0.2.0

func (s *Config) ToBodyMap() (common.BodyMap, error)

ToBodyMap returns the parsed map, for use by the configs package.

func (*Config) ToOsEnviron added in v0.2.0

func (s *Config) ToOsEnviron() (Envs, error)

ToOsEnviron returns the config, converted to a list of "K=V" lines

type Envs added in v0.2.0

type Envs []string

Envs is the type of an os.Environ-provided env-list.

Jump to

Keyboard shortcuts

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