Documentation ¶
Index ¶
- func AddrCheck(addr string) bool
- func CreateToken(userId int64) (string, error)
- func GetDeviceID(sid int64) (datacenterid, workerid int64)
- func GetGenTime(sid int64) (t string)
- func GetGenTimestamp(sid int64) (timestamp int64)
- func GetMQUrl() string
- func GetMysqlDSN() string
- func GetTimestamp(sid int64) (timestamp int64)
- func GetTimestampStatus() (state float64)
- func IsVideoFile(header *multipart.FileHeader) bool
- func MD5(str string) string
- func MD5Bytes(str []byte) string
- func SHA256(str string) string
- type Claims
- type SensitiveTrie
- type Snowflake
- type TrieNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
func GetMysqlDSN ¶
func GetMysqlDSN() string
func IsVideoFile ¶
func IsVideoFile(header *multipart.FileHeader) bool
Types ¶
type Claims ¶
type Claims struct { UserId int64 `json:"user_id"` jwt.StandardClaims }
func CheckToken ¶
type SensitiveTrie ¶
type SensitiveTrie struct {
// contains filtered or unexported fields
}
SensitiveTrie 敏感词前缀树
func (*SensitiveTrie) AddWord ¶
func (st *SensitiveTrie) AddWord(sensitiveWord string)
AddWord 添加敏感词
func (*SensitiveTrie) AddWords ¶
func (st *SensitiveTrie) AddWords(sensitiveWords []string)
AddWords 批量添加敏感词
func (*SensitiveTrie) FilterSpecialChar ¶
func (st *SensitiveTrie) FilterSpecialChar(text string) string
FilterSpecialChar 过滤特殊字符
type Snowflake ¶
func NewSnowflake ¶
Click to show internal directories.
Click to hide internal directories.