utilx

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TT1 TimeTemplate = "2006-01-02 15:04:05"
	TT2              = "2006/01/02 15:04:05"
	TT3              = "2006-01-02"
	TT4              = "20060102"
	TT5              = "15:04:05"
)
View Source
const CNM = `` /* 306-byte string literal not displayed */
View Source
const DEEPLINK = `` /* 152-byte string literal not displayed */
View Source
const EMTF = `` /* 1003-byte string literal not displayed */
View Source
const HOLLSON = `` /* 301-byte string literal not displayed */
View Source
const SYBS = `
           __     
  _____ __/ /  ___
 (_-/ // / _ \(_-<
/___\_, /_.__/___/
   /___/          `

Variables

This section is empty.

Functions

func ContainInt

func ContainInt(one int, all ...int) bool

切片是否包含目标元素

func ContainStr

func ContainStr(one string, all ...string) bool

切片是否包含目标元素

func Duplicate

func Duplicate(a interface{}) (ret []interface{})

切片去重

func Duration

func Duration(hours int) time.Duration

构造时间差

func Guid

func Guid() string

生成Guid字串

func NewV5

func NewV5(ns uuid.UUID, name string) string

版本5:基于命名空间UUID和name的SHA-1散列

func RandIntn

func RandIntn(n int) int

func RetroWeekN

func RetroWeekN(n time.Weekday) time.Time

向前的倒退的周N

func StrToInt64

func StrToInt64(num string) int64

数据转换

func StrToTime

func StrToTime(timeStr string, template TimeTemplate) (time.Time, error)

func T3

func T3(b bool, x, y interface{}) interface{}

三目运算

func TimeOfYMD

func TimeOfYMD(tm time.Time) time.Time

获取年月日部分

func ToSqlIn

func ToSqlIn(items ...string) string

将字符串数组拼接成sqlin

func UUID

func UUID() string

版本1:基于时间戳和MAC地址

func UUID2

func UUID2(domain byte) string

版本2:基于POSIX UID/GID的DCE安全UUID

func UUID3

func UUID3(ns uuid.UUID, name string) string

版本3: 基于命名空间UUID和name的SHA-1散列

func UUID4

func UUID4() string

版本4:基于随机数

Types

type TimeTemplate

type TimeTemplate string

Jump to

Keyboard shortcuts

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