utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64De

func Base64De(data string) ([]byte, error)

Base64De encod string

func Base64En

func Base64En(data []byte) string

Base64En encod []byte

func CheckHttpHealthy added in v0.0.4

func CheckHttpHealthy(u string, timeout time.Duration) (ok bool, delay time.Duration, err error)

func DayStart added in v0.0.3

func DayStart(t time.Time) time.Time

func EncryptPwd

func EncryptPwd(pwd []byte) string

EncryptPwd 密码加密

func HmacSha1

func HmacSha1(key, value []byte) ([]byte, error)

HmacSha1 hmac sha1 加密

func IsDigit added in v0.0.4

func IsDigit(s string) bool

func MD5

func MD5(data []byte) string

MD5 use md5 encrypt

func NDaysAgo added in v0.0.4

func NDaysAgo(t time.Time, n int) time.Time

NDaysAgo N天前

func NewLocalIPNet

func NewLocalIPNet() []*net.IPNet

func NewPostJsonRequest

func NewPostJsonRequest(url string, body interface{}) (*http.Request, error)

func NewPutJsonRequest

func NewPutJsonRequest(url string, body interface{}) (*http.Request, error)

func NullBool

func NullBool(d bool) sql.NullBool

func NullInt64

func NullInt64(d int64) sql.NullInt64

func NullString

func NullString(d string) sql.NullString

func NullTime

func NullTime(d time.Time) pq.NullTime

func Percent added in v0.0.4

func Percent(molecular, denominator uint64) float64

func PrintTable

func PrintTable(writer io.Writer, headers []string, data [][]string)

func RandmonCode

func RandmonCode(bitNumber int) string

RandmonCode 生成指定位数随机数

func RandomString

func RandomString(l int) string

RandomString 生成随机字符串

func SQLLog

func SQLLog(w io.Writer) func(d string, args ...interface{})

func Sha1

func Sha1(data string) string

func Sha256

func Sha256(data string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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