utils

package
v0.0.0-...-cc72008 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 12 Imported by: 14

Documentation

Index

Constants

View Source
const ISO8601 = "2006-01-02T15:04:05.000Z"

ISO8601 ...

Variables

This section is empty.

Functions

func A

func A(i interface{}) []interface{}

A 将 interface{} 转换为 []interface{}

func Compare

func Compare(password string, hashedPassword string) bool

Compare ...

func CompareArray

func CompareArray(i1, i2 interface{}) bool

CompareArray 比较两个数组是否相等,忽略数组顺序

func Copy

func Copy(src interface{}) interface{}

Copy creates a deep copy of whatever is passed to it and returns the copy in an interface{}. The returned value will need to be asserted to the correct type.

func CopyMap

func CopyMap(m map[string]interface{}) map[string]interface{}

CopyMap 复制 map

func CopyMapM

func CopyMapM(m types.M) types.M

CopyMapM 复制 map

func CopySlice

func CopySlice(s []interface{}) []interface{}

CopySlice 复制 slice

func CopySliceS

func CopySliceS(s types.S) types.S

CopySliceS 复制 slice

func CreateFileName

func CreateFileName() string

CreateFileName ...

func CreateObjectID

func CreateObjectID() string

CreateObjectID ...

func CreateString

func CreateString(n int) string

func CreateToken

func CreateToken() string

CreateToken ...

func DeepCopy

func DeepCopy(i interface{}) interface{}

DeepCopy 简易版的内存复制

func ExtName

func ExtName(filename string) string

ExtName 取文件名中的扩展名

func HasResults

func HasResults(response types.M) bool

HasResults Find() 返回数据中是否有结果

func Hash

func Hash(password string) string

Hash ...

func Iface

func Iface(iface interface{}) interface{}

Iface is an alias to Copy; this exists for backwards compatibility reasons.

func IsEmail

func IsEmail(email string) bool

IsEmail ...

func IsFileName

func IsFileName(filename string) bool

IsFileName 判断是否是有效的文件名

func LookupContentType

func LookupContentType(filename string) string

LookupContentType 查找 ContentType

func LookupExtension

func LookupExtension(mimeType string) string

LookupExtension 查找扩展名

func M

func M(i interface{}) map[string]interface{}

M 将 interface{} 转换为 map[string]interface{}

func MD5Hash

func MD5Hash(s string) string

MD5Hash ...

func S

func S(i interface{}) string

String 将 interface{} 转换为 string

func StringtoTime

func StringtoTime(s string) (time.Time, error)

StringtoTime ...

func StringtoUnixmilli

func StringtoUnixmilli(s string) (int64, error)

StringtoUnixmilli ...

func TimetoString

func TimetoString(t time.Time) string

TimetoString ...

func TimetoUnixmilli

func TimetoUnixmilli(t time.Time) int64

TimetoUnixmilli ...

func UnixmillitoString

func UnixmillitoString(m int64) string

UnixmillitoString ...

func UnixmillitoTime

func UnixmillitoTime(m int64) time.Time

UnixmillitoTime ...

Types

This section is empty.

Jump to

Keyboard shortcuts

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