util

package
v0.0.0-...-3b5ec37 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcFileSHA

func CalcFileSHA(filename string) (*string, error)

CalcFileSHA return the SHA1 hash of the given file.

func CalcSHA

func CalcSHA(in []byte) *string

func Error

func Error(e ...interface{}) error

func FileExists

func FileExists(filename string) (bool, error)

FileExists checks for the existence of the given file.

func LogError

func LogError(log *logrus.Entry, e ...interface{}) error

LogError logs an error on a logrus entry

func RandomString

func RandomString(n int) string

RandomString returns a random string of n characters.

func ToError

func ToError(args []interface{}) error

func WorkingDir

func WorkingDir(d string) string

WorkingDir returns the passed directory, or the current working directory if d is an empty string.

Types

type Timer

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

func NewTimer

func NewTimer(msg string) *Timer

func (*Timer) Close

func (t *Timer) Close()

func (*Timer) Mark

func (t *Timer) Mark(m string)

Jump to

Keyboard shortcuts

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