Documentation ¶
Index ¶
- Constants
- Variables
- func CacheTime() string
- func Dup(from, to int) error
- func GenerateUUID() string
- func GoWithRecover(handler func(), recoverHandler func(r interface{}))
- func ReadJsonFile(file string, v interface{}) error
- func ResetHjiackStdPipeline()
- func SetHijackStdPipeline(filepath string, stdout, stderr bool)
- func WriteFileSafety(filename string, data []byte, perm os.FileMode) (err error)
- type Ticker
- type Timer
Constants ¶
View Source
const JsonExt = ".json"
Variables ¶
View Source
var ErrIgnore = errors.New("error ignore")
Functions ¶
func CacheTime ¶
func CacheTime() string
CacheTime returns a time cache in seconds. we use a cache to reduce the format
func GenerateUUID ¶
func GenerateUUID() string
GenerateUUID generates an uuid https://tools.ietf.org/html/rfc4122 crypto.rand use getrandom(2) or /dev/urandom It is maybe occur an error due to system error panic if an error occurred
func GoWithRecover ¶
func GoWithRecover(handler func(), recoverHandler func(r interface{}))
GoWithRecover wraps a `go func()` with recover()
func ReadJsonFile ¶
ReadJsonFile reads a json into interface If a file is not .json ignore it If a file is empty, ignore it
func ResetHjiackStdPipeline ¶
func ResetHjiackStdPipeline()
func SetHijackStdPipeline ¶
SetHijackStdPipeline hijacks stdout and stderr outputs into the file path
Types ¶
Click to show internal directories.
Click to hide internal directories.