util

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = logrus.New()

Logger is the default logger with info level

Functions

func Command added in v0.0.2

func Command(cmd string) (*exec.Cmd, error)

Command return a Command struct from a full commad

func FileExists added in v0.0.3

func FileExists(path string) bool

FileExists return if a file exists and can be read by current program http://stackoverflow.com/questions/12518876/how-to-check-if-a-file-exists-in-go

func GetWithDefault added in v0.0.2

func GetWithDefault(m map[string]interface{}, key string, d interface{}) interface{}

GetWithDefault return default vaule if certain key does not exists

func HasKey added in v0.0.2

func HasKey(m map[string]interface{}, key string) bool

HasKey is a shortcut for checking if certain key exists in map

func RunCommand added in v0.0.2

func RunCommand(cmd string) error

RunCommand runs a commad and show all output in console, block current routine

func UseVerboseLog added in v0.0.2

func UseVerboseLog()

UseVerboseLog set logger level to debug

func ViperGetStringOrFail added in v0.0.3

func ViperGetStringOrFail(key string) (string, error)

ViperGetStringOrFail returns string without any convertion FIXED: https://github.com/dyweb/Ayi/issues/54

func ViperReadAndMerge added in v0.0.3

func ViperReadAndMerge(path string)

ViperReadAndMerge read specified config file and merge

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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