tools

package
v1.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: May 23, 2017 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(src []byte) ([]byte, error)

func Base64Encode

func Base64Encode(src []byte) []byte

func BytesToHexString

func BytesToHexString(data []byte) []string

Convert byte array to hex string .

func DeleteSlice

func DeleteSlice(slice interface{}, index int) (interface{}, error)

selete slice

func Md5Encrypt

func Md5Encrypt(data string) string

func RsaDecrypt

func RsaDecrypt(ciphertext []byte, privateKey string) ([]byte, error)

func RsaEncrypt

func RsaEncrypt(origData []byte, publicKey string) ([]byte, error)

func StringToHexString

func StringToHexString(str string) []string

Convert string to hex string

Types

type DateTool

type DateTool struct {
}

时间工具

func (*DateTool) CurrentUnixTimestamp

func (this *DateTool) CurrentUnixTimestamp() int64

func (*DateTool) Format

func (this *DateTool) Format(timestamp int64, layoutString string) string

fmt.Println(tm.Format("2006-01-0203:04:05PM")) fmt.Println(tm.Format("02/01/200615:04:05PM"))

func (*DateTool) FormatUnixTimestamp

func (this *DateTool) FormatUnixTimestamp(timestamp int64) time.Time

func (*DateTool) GetFutureWeekIntervalOffset

func (this *DateTool) GetFutureWeekIntervalOffset(weekday int, offset int64) (int64, int64)

获取多个偏移 n个 23:59:59 - 00:00:00

func (*DateTool) GetLastWeekInterval

func (this *DateTool) GetLastWeekInterval(weekday int) (int64, int64)

获取某一天的凌晨开始 向前一个周的该天的凌晨 00:00:00 返回begin end timestamp

func (*DateTool) GetLastWeekIntervalOffset

func (this *DateTool) GetLastWeekIntervalOffset(weekday int, offset int64) (int64, int64)

获取多个偏移 n个 23:59:59 - 00:00:00

func (*DateTool) GetMonthDays

func (this *DateTool) GetMonthDays(month, year int) int

获取指定年月份的天数

func (*DateTool) GetNowUnixTimestamp

func (this *DateTool) GetNowUnixTimestamp() int64

获取当前时间戳

func (*DateTool) MonthStrToInt

func (this *DateTool) MonthStrToInt(month string) int

convert month string to month

func (*DateTool) NowHMS

func (this *DateTool) NowHMS() (int, int, int)

get hour minutes second

func (*DateTool) ParseDatetimeString

func (this *DateTool) ParseDatetimeString(datetime string) (time.Time, error)

func (*DateTool) TodayWeekday

func (this *DateTool) TodayWeekday() (string, int)

获取今天是星期几

func (*DateTool) TodayYMD

func (this *DateTool) TodayYMD() (int, int, int)

today y m d

func (*DateTool) UnixToYMD

func (this *DateTool) UnixToYMD(unixTimestamp int64) (int, int, int)

Jump to

Keyboard shortcuts

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