utils

package
Version: v0.0.0-...-043d1ac Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: AGPL-3.0-or-later, GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsDir

func ContainsDir(pth string) (hasDir bool, err error)

func Copy

func Copy(sourcePath, destPath string) (err error)

func CopyAll

func CopyAll(sourcePath, destPath string) (err error)

func Create

func Create(path string) (file *os.File, err error)

func CreateWrite

func CreateWrite(path string, data string) (err error)

func Exec

func Exec(dir, name string, arg ...string) (err error)

func ExecInput

func ExecInput(dir, input, name string, arg ...string) (err error)

func ExecOutput

func ExecOutput(dir, name string, arg ...string) (output string, err error)

func ExecSilent

func ExecSilent(dir, name string, arg ...string) (err error)

func Exists

func Exists(pth string) (exists bool, err error)

func ExistsDir

func ExistsDir(pth string) (exists bool, err error)

func ExistsFile

func ExistsFile(pth string) (exists bool, err error)

func ExistsMkdir

func ExistsMkdir(pth string, perm os.FileMode) (err error)

func ExistsRemove

func ExistsRemove(pth string) (err error)

func GetRemoteAddr

func GetRemoteAddr(c *gin.Context) (addr string)

func GitChanged

func GitChanged(pth, commitX, commitY string) (changed set.Set, err error)

func GitCommit

func GitCommit(pth string) (commit string, err error)

func Max

func Max(x, y int) int

func MemoryUsed

func MemoryUsed() (used float64, err error)

func Min

func Min(x, y int) int

func ParseObjectId

func ParseObjectId(strId string) (objId bson.ObjectId, ok bool)

func RandBytes

func RandBytes(size int) (bytes []byte, err error)

func RandName

func RandName() (name string)

func Remove

func Remove(path string) (err error)

func RemoveAll

func RemoveAll(path string) (err error)

func VersionNewer

func VersionNewer(x, y string) bool

Types

type LoadStat

type LoadStat struct {
	Load1  float64
	Load5  float64
	Load15 float64
}

func LoadAverage

func LoadAverage() (ld *LoadStat, err error)

Jump to

Keyboard shortcuts

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