util

package
v0.0.0-...-e4b34aa Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(c string, l []string) bool

func CopyFile

func CopyFile(from string, todir string, tofile string)

func CreateDir

func CreateDir(path string, dirname string) string

func CreateDirFromPath

func CreateDirFromPath(dir string) string

func CreateFile

func CreateFile(path string, fname string) *os.File

func DirMustExist

func DirMustExist(path string)

func Emit

func Emit(f *os.File, format string, a ...interface{})

func Execute

func Execute(name string, args ...string) string

func Fail

func Fail(data string, args ...interface{})

func FetchFile

func FetchFile(dir string, url string, file string) string

func FetchFiles

func FetchFiles(dir string, url string, files []string)

func FileExists

func FileExists(path string) bool

func FileMustExist

func FileMustExist(path string)

func FindIDFile

func FindIDFile() (string, string)

func GetHomeDir

func GetHomeDir() string

func Info

func Info(data string, args ...interface{})

func LoadAsYaml

func LoadAsYaml(path string, b interface{})

func LoadFile

func LoadFile(file string) string

func LoadFromJsonFile

func LoadFromJsonFile(ignfile string) map[string]interface{}

func MoveFile

func MoveFile(from string, to string)

func Parse

func Parse(title string, c interface{}, g string) string

func ReadURLFile

func ReadURLFile(url string) string

func RecreateDir

func RecreateDir(path string, dirname string) string

func SaveAsJson

func SaveAsJson(path string, d interface{})

func SaveAsYaml

func SaveAsYaml(path string, d interface{})

func Section

func Section(data string, args ...interface{})

func SpeculativeExecute

func SpeculativeExecute(name string, args ...string) (string, error)

func ToInt

func ToInt(n string) int

func ToString

func ToString(n int) string

func Warn

func Warn(data string, args ...interface{})

func WriteFile

func WriteFile(dir string, fname string, contents string)

func WriteFile2

func WriteFile2(path string, contents string)

func WriteTemplate

func WriteTemplate(g interface{}, path string, data string)

Types

type Text

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

func CreateText

func CreateText() *Text

func (*Text) Add

func (t *Text) Add(format string, a ...interface{})

func (*Text) AsString

func (t *Text) AsString() string

Jump to

Keyboard shortcuts

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