iv

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: BSD-3-Clause Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Marshal = func(v interface{}) (io.Reader, error) {
	b, err := json.MarshalIndent(v, "", "\t")
	if err != nil {
		return nil, err
	}
	return bytes.NewReader(b), nil
}

Marshal is a function that marshals the object into an io.Reader. By default, it uses the JSON marshaller.

Functions

func CWD

func CWD() string

CWD - Get the current binary location for this application i.e. /usr/local/bin

func ExpandPath

func ExpandPath(path *string)

ExpandPath - If the path is ~, this function will expand it to its full form (/home/<user>)

func Load

func Load(v interface{}, path *string) error

Load (path string) interface - load config file and return interface

func Save

func Save(v interface{}, path *string) error

Save saves a representation of v to the file at path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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