Documentation
¶
Index ¶
- Constants
- func BytesToInt64(buf []byte) int64
- func Compare(encryptStr, str string) bool
- func Compress(data []byte) ([]byte, error)
- func Decompress(data []byte) ([]byte, error)
- func FormatInt(i int) string
- func FormatIntv(v interface{}) string
- func GenerateRandom() uint64
- func GenerateUUID() string
- func GenerateUUID2Number() uint64
- func GenerateUUIDWithOutLine() string
- func Get(str string) (string, error)
- func GetID() snowflake.ID
- func GetSalt(encryptStr string) string
- func GetTimeFromNTP() time.Time
- func IntToInt64(value int) int64
- func IsNumeric(s string) bool
- func JsonString(v interface{}) string
- func PrettyJson(data interface{}) (string, error)
- func RandString(len int) string
- func SmsContentEncode(signature, content string) string
- func StringToInt(value string) (i int)
- func Stringify(data interface{}) (string, error)
- func StructToMap(obj interface{}) map[string]interface{}
- func Structify(data string, value interface{}) error
- func ToInt64(value interface{}) (d int64, err error)
- func ToSnakeCase(str string) string
- type Time
Constants ¶
View Source
const ( // IDpool 大小 IDpoolCount = 1000 // 添加门槛 AddThreshold = 300 )
View Source
const (
//$2a$(2 chars work cost)$(22 chars salt )(31 chars hash)
DefaultSaltLen = 29
)
Variables ¶
This section is empty.
Functions ¶
func Decompress ¶
Decompress returns the decompressed bytes
func FormatIntv ¶
func FormatIntv(v interface{}) string
func GenerateUUID ¶
func GenerateUUID() string
func GenerateUUID2Number ¶
func GenerateUUID2Number() uint64
func GenerateUUIDWithOutLine ¶
func GenerateUUIDWithOutLine() string
func GetTimeFromNTP ¶
func JsonString ¶
func JsonString(v interface{}) string
func PrettyJson ¶
PrettyJson returns a pretty json string
func SmsContentEncode ¶
GBK 编码短信内容, 需带上签名, 如果不需要签名,可以传 "" (目前只有验证码签名写死在内容中,传的签名为 "" )
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
结构体转 map 根据 json tag, 没有就把名字 ToSnakeCase
func ToSnakeCase ¶
Types ¶
type Time ¶
func (Time) MarshalJSON ¶
func (*Time) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.