util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GoTimeStart = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func DateAdd

func DateAdd(day int) string

func DateNow

func DateNow() string

func DateTime

func DateTime() int64

func DecryptEncryptedData

func DecryptEncryptedData(encryptedData, sessionKey, iv string) ([]byte, error)

解密微信加密数据

func DesDecryptStr

func DesDecryptStr(src, key, iv string) ([]byte, error)

3DES解密

func DesEncryptStr

func DesEncryptStr(src []byte, key, iv string) (string, error)

3DES加密

func DoGet

func DoGet(url string, param map[string]string, resp interface{}) error

func DoPost

func DoPost(url string, param interface{}, resp interface{}) error

func DoPostXMLWithTLS

func DoPostXMLWithTLS(uri string, obj interface{}, resp interface{}, ca, key string) error

func Dump

func Dump(i interface{}, tag string)

输出调试

func RandInt

func RandInt(min, max int) int

随机一个区间整数

func RandIntSlice

func RandIntSlice(max, length int) []int

随机一个定长数组

func Str2Time

func Str2Time(s string) (int64, error)

func SubStr

func SubStr(str string, limit int, suffix string) string

截取字符串

func TodayUnix

func TodayUnix() int64

Types

type LocalDate

type LocalDate struct {
	time.Time
}

func (LocalDate) MarshalJSON

func (l LocalDate) MarshalJSON() ([]byte, error)

MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S

func (*LocalDate) Scan

func (l *LocalDate) Scan(v interface{}) error

Scan valueof time.Time

func (LocalDate) Value

func (l LocalDate) Value() (driver.Value, error)

Value insert timestamp into mysql need this function.

type V

type V interface {
	Bytes() []byte
	String() string
	Int64() int64
	Int() int
	Uint() uint
	Float64() float64
	Uint64() uint64
	Bool() bool
}

V interface{}类型转换

func TypeTo

func TypeTo(v interface{}) V

TypeTo 获取转换interface{}

Jump to

Keyboard shortcuts

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