Documentation ¶
Overview ¶
* @Author: your name * @Date: 2021-06-07 09:13:06 * @LastEditTime: 2021-08-12 17:13:29 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: /nethopper/utils/token.go
Index ¶
- func Abs(i int) int
- func Abs32(i int32) int32
- func CallOpt() int32
- func CopyFloat32Map(source map[int32]float32) map[int32]float32
- func CopyFloat64Map(source map[int32]float64) map[int32]float64
- func CopyInt32Map(source map[int32]int32) map[int32]int32
- func CopyInt64Map(source map[int32]int64) map[int32]int64
- func CopyJSON(marshaler interface{}, unMarshaler interface{}) error
- func CopyMapInt32(a map[int32]int32) map[int32]int32
- func CreateRandArray(max int, length int) []int
- func CreateToken(secret string, content string, expire time.Duration) (string, error)
- func CreateUniqRandArray(max int, length int) []int
- func DeepClone(v interface{}) interface{}
- func DeepCoderCopy(dst, src interface{}) error
- func DeepCopy(dst, src interface{})
- func Dump(data ...interface{})
- func FileIsExist(path string) bool
- func FileLines(filename string) (int32, error)
- func FilterByGeneric[V any](elems []V, predicate func(V) bool) []V
- func FilterOneByGeneric[V any](elems []V, predicate func(V) bool) V
- func Float64Bits(f float64, d int)
- func GenUID() uint64
- func GenUUID() string
- func GetAbsDirectory(filename string) string
- func GetAbsFilePath(filename string) string
- func GetDumpString(data ...interface{}) string
- func GetEmptyTime() time.Time
- func GetGID() uint64
- func GetLocalIP() string
- func GetTodayHourTime(hour int) time.Time
- func GetTodayTime() time.Time
- func GetTomorrowTime() time.Time
- func GetWorkDirectory() (string, error)
- func Hour(t time.Time) int64
- func HourNow() string
- func HourTimestamp() int64
- func I32Clamp(value, min, max int32) int32
- func I32Max(a, b int32) int32
- func I32Min(a, b int32) int32
- func I64Clamp(value, min, max int64) int64
- func I64Max(a, b int64) int64
- func I64Min(a, b int64) int64
- func IClamp(value, min, max int) int
- func IMax(a, b int) int
- func IMin(a, b int) int
- func Implode(list interface{}, seq string) string
- func InitUID(workID uint16)
- func Int64ToString(v int64) string
- func InvSqrt(x float32) float32
- func JSON2Map(s string) (map[string]interface{}, error)
- func LocalMilliscond() int64
- func LocalTimestamp() int64
- func Map2Struct(data map[string]interface{}, out interface{}) error
- func MargeMap(a map[int32]int32, b map[int32]int32)
- func PowerCalc(size int32) (int32, uint8)
- func PrintPointerInfo(buf *bytes.Buffer, headlen int, pointers *pointerInfo)
- func RandomInt(from, to int) int
- func RandomInt32(from, to int32) int32
- func RandomMultiWeight(weightMapping map[int32]int32, count int) []int32
- func RandomWeight(weightMapping map[int32]int32) int32
- func Round(value float64) int32
- func Round64(value float64) int64
- func RoundFloat64(value float64) float64
- func RoundN(f float64, n int) float64
- func RuntimeStats(gc bool, heapObj bool, goroutineNum bool) []int64
- func Shuffle(list []interface{})
- func ShuffleI(list []int)
- func ShuffleI32(list []int32)
- func ShuffleN(list []interface{}, randCount int) []interface{}
- func ShuffleNI32(list []int32, randCount int) []int32
- func ShuffleR(list []interface{})
- func Stack(skip int, indent string) []byte
- func StaticRand(seedrare, min, max int) int
- func Str2Bool(s string) bool
- func Str2Float32(s string) float32
- func Str2Float64(s string) float64
- func Str2Int(s string) int
- func Str2Int16(s string) int16
- func Str2Int32(s string) int32
- func Str2Int64(s string) int64
- func Str2Int8(s string) int8
- func Str2Uint(s string) uint
- func Str2Uint16(s string) uint16
- func Str2Uint32(s string) uint32
- func Str2Uint64(s string) uint64
- func Str2Uint8(s string) uint8
- func StrSub(str string, start int, end int) string
- func StringToInt64(s string) int64
- func Struct2Map(obj interface{}) map[string]interface{}
- func SumI32(list []int32) int32
- func SumMatrixColI32(mat [][]int32, col int) int32
- func TimeFormat(t time.Time) string
- func TimeYMD() string
- func TimeYMDH() string
- func TimeYMDHIS() string
- func Today() string
- func TodayTimestamp() int64
- func Tomorrow() string
- func ValidToken(secret string, token string) (string, error)
- type Any
- type BitFlag
- type Promise
- type Time
- func (m Time) Date() string
- func (m Time) MarshalJSON() ([]byte, error)
- func (m Time) RedisArg() interface{}
- func (m *Time) RedisScan(src interface{}) error
- func (m *Time) Scan(v interface{}) error
- func (m Time) String() string
- func (m Time) Timestamp() string
- func (m *Time) UnmarshalJSON(data []byte) error
- func (m Time) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRandArray ¶
CreateRandArray 创建随机数 [0,max)数组,返回随机数序列,可能会有重复
func CreateToken ¶
CreateToken token create
func CreateUniqRandArray ¶
CreateUniqRandArray 创建唯一随机数 [0,max)数组,返回一个数组序列,没有重复数
func DeepCoderCopy ¶
func DeepCoderCopy(dst, src interface{}) error
func FilterByGeneric ¶
func FilterOneByGeneric ¶
func GetAbsDirectory ¶
GetAbsDirectory get file directory abs path
func GetDumpString ¶
func GetDumpString(data ...interface{}) string
GetDumpString return data print string
func GetWorkDirectory ¶
GetWorkDirectory get current exec file directory
func Map2Struct ¶
Map2Struct map转换为struct
func PrintPointerInfo ¶
PrintPointerInfo dump pointer value
func RandomMultiWeight ¶
RandomMultiWeight 随机多个权重
func RuntimeStats ¶
获取常用runtime统计信息
func StringToInt64 ¶
StringToInt64 convert string to int64,if err return 0
func TimeYMDHIS ¶
func TimeYMDHIS() string
TimeYMDHIS get current time return format yearmouthday hour:minute:second
Types ¶
type Promise ¶
type Promise struct {
// contains filtered or unexported fields
}
type Time ¶
Time 可在JSON中序列化的时间类型
func StrToJSONTime ¶
StrToJSONTime 字符串转换为JSONTime layout为""时默认使用2006-01-02 15:04:05格式 其他时候使用layout的format
func (Time) MarshalJSON ¶
MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S
func (*Time) UnmarshalJSON ¶
UnmarshalJSON JSON反序列接口的实现