handy

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2020 License: MIT Imports: 17 Imported by: 7

README

handy

handy tool set for golang

Documentation

Index

Constants

View Source
const (
	StrEmpty     = ""
	StrColon     = ":"
	StrLine      = "\n"
	StrAnd       = "&"
	StrQuestion  = "?"
	StrEqual     = "="
	StrSpace     = " "
	StrSlash     = "\\"
	StrBackslash = "/"
	StrHyphen    = "-"
	StrTilde     = "~"
	StrDot       = "."
	StrComma     = ","
)
View Source
const (
	DateGMT       = "Mon, 02 Jan 2006 15:04:05 GMT"
	DateLunar     = "2006-01-02 15:04:05"
	DateTZ        = "2006-01-02T15:04:05Z"
	DateLunarNano = "2006-01-02 15:04:05.000000000"
)

Variables

This section is empty.

Functions

func Abs

func Abs(n int64) int64

Abs completes abs for int64. Please see https://wuyin.io/2018/02/07/optimized-abs-func-for-int64-in-Go/.

func BuildHMAC

func BuildHMAC(key, data string, hf hashFunc) []byte

func BuildHMAC1

func BuildHMAC1(key, data string) []byte

func BuildHMAC256

func BuildHMAC256(key, data string) []byte

func BuildMD5

func BuildMD5(parts ...string) string

func Bytes2Str

func Bytes2Str(b []byte) string

func Choose

func Choose(weights []uint32) (index int, ok bool)

func EncodeToBase64

func EncodeToBase64(data []byte) string

func GetFuncName

func GetFuncName(f interface{}) string

func GetUUID

func GetUUID() (string, error)

func InternBytes

func InternBytes(b []byte) string

func InternString

func InternString(s string) string

func IsEmptyStr

func IsEmptyStr(s string) bool

func Microsecond

func Microsecond() int64

func Millisecond

func Millisecond() int64

func Nanosecond

func Nanosecond() int64

func Second

func Second() int64

func Str2Bytes

func Str2Bytes(s string) []byte

func Stringify

func Stringify(obj interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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