utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const EmptyString = ""

Variables

View Source
var NilPointerError = errors.New("nil pointer error")
View Source
var Validate *validator.Validate

Functions

func BaseDir added in v0.2.0

func BaseDir(s string) string

func Basename

func Basename(s string) string

func ChangeWorkDir

func ChangeWorkDir(workDir string) error

func CreateFile

func CreateFile(path, filename string) error

func DirName added in v0.2.0

func DirName(s string) string

func EnsureWorkDir added in v0.2.0

func EnsureWorkDir(path string) string

func Filename

func Filename(s string) string

func GetFieldValue

func GetFieldValue(f interface{}, name string) reflect.Value

GetFieldValue get filed value in reflected format

func GetMatches added in v0.2.0

func GetMatches(source string) [][]string

func GetReferenceValue added in v0.2.0

func GetReferenceValue(object interface{}, name string) reflect.Value

func GetRelativePath

func GetRelativePath(level int) string

func GetWorkDir

func GetWorkDir() string

func IsPathNotExist

func IsPathNotExist(path string) bool

func LowerFirst

func LowerFirst(str string) string

LowerFirst lower case first character of specific string

func ParseReferences

func ParseReferences(st interface{}, varName []string) string

ParseReferences parse the variable references

func ParseVariables

func ParseVariables(src string, re *regexp.Regexp) [][]string

ParseVariables parse reference and env variables

func Replace

func Replace(to interface{}, root interface{}) error

Replace given env and reference variables inside specific struct

func ReplaceMap added in v0.2.0

func ReplaceMap(m map[string]interface{}, root interface{}) error

ReplaceMap replace references and env variables

func ReplaceStringVariables

func ReplaceStringVariables(source string, t interface{}) string

ReplaceStringVariables replace reference and env variables

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice check if specific string is in slice

func UpperFirst

func UpperFirst(str string) string

UpperFirst upper case first character of specific string

func Visit

func Visit(files *[]string) filepath.WalkFunc

func WriterFile

func WriterFile(path, filename string, in []byte) (int, error)

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