common

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteTmpl added in v0.10.0

func ExecuteTmpl(w io.Writer, text string, data interface{}) error

ExecuteTmpl parse and execute template

func ExecuteTmplToFile added in v0.10.0

func ExecuteTmplToFile(target, text string, data interface{}) error

ExecuteTmplToFile parse and execute template to file

func LoadEnv added in v0.10.0

func LoadEnv(filename string) error

LoadEnv to setenv from file

func Setenv added in v0.10.0

func Setenv(m EnvMap) error

Setenv set environment variable based on map

func Unsetenv added in v0.10.0

func Unsetenv(m EnvMap) error

Unsetenv unset environment variable

Types

type EnvMap added in v0.10.0

type EnvMap map[string]string

EnvMap map contain environment variable

func CreateEnvMap added in v0.10.0

func CreateEnvMap(r io.Reader) (m EnvMap)

CreateEnvMap create EnvMap instance from reader

func CreateEnvMapFromFile added in v0.10.0

func CreateEnvMapFromFile(source string) (EnvMap, error)

CreateEnvMapFromFile to create EnvMap from file

func (EnvMap) Keys added in v0.10.0

func (m EnvMap) Keys() []string

Keys of EnvMap

func (EnvMap) Save added in v0.10.0

func (m EnvMap) Save(w io.Writer) error

Save envmap to writer

func (EnvMap) SaveToFile added in v0.10.0

func (m EnvMap) SaveToFile(target string) error

SaveToFile save envmap to file

type Errors

type Errors []error

Errors to handle multiple error

func (*Errors) Append

func (e *Errors) Append(errs ...error) *Errors

Append error

func (*Errors) Join

func (e *Errors) Join(sep string) string

Join list of item to string

func (*Errors) Unwrap

func (e *Errors) Unwrap() error

Unwrap to error type https://blog.golang.org/go1.13-errors#TOC_3.1.

Jump to

Keyboard shortcuts

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