utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	KB int64
	MB
	GB
)

FileSize util

Variables

This section is empty.

Functions

func CallerFile

func CallerFile(skipStack int) string

CallerFile returns path to caller file

func CallerFileName

func CallerFileName(skipStack int) string

CallerFileName returns name of caller file

func Env

func Env(key, fallback string) string

Env returns env variable, fallback when no there

func EnvInt

func EnvInt(key string) int

EnvInt is Env + convert to int

func EnvLookup

func EnvLookup(key string) (string, bool)

EnvLookup alias os.LookupEnv + .env

func EnvUint

func EnvUint(key string) uint

EnvUint is Env + convert to uint

func OnExit

func OnExit(handlers ...func(os.Signal))

OnExit program

func RandInit

func RandInit()

RandInit for init rand seed from time

func RandLetterBytes

func RandLetterBytes(n int) []byte

RandLetterBytes fast generator

func RandString

func RandString(n int) string

RandString fast generator

func Workdir

func Workdir() string

Workdir returns executable working dir

Types

This section is empty.

Jump to

Keyboard shortcuts

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