env

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

Config implementation for handling environment vars.

func New

func New(r io.Reader) (*Config, error)

New creates a new config. By providing a reader, which might contain environment variables coming for a file, you can set env vars. This is useful for development.

func (*Config) Get

func (c *Config) Get(key string) (interface{}, error)

Get a env var.

func (*Config) GetBool

func (c *Config) GetBool(key string) (bool, error)

GetBool returns a bool env var.

func (*Config) GetFloat64

func (c *Config) GetFloat64(key string) (float64, error)

GetFloat64 returns a float64 env var.

func (*Config) GetInt64

func (c *Config) GetInt64(key string) (int64, error)

GetInt64 returns a int64 env var.

func (*Config) GetString

func (c *Config) GetString(key string) (string, error)

GetString returns a string env var.

func (*Config) Set

func (c *Config) Set(key string, value interface{}) error

Set a environment var.

Jump to

Keyboard shortcuts

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