Documentation ¶
Index ¶
- func AddrCheck(addr string) bool
- func CreateToken(userId int64) (string, error)
- func FileToByteArray(file *multipart.FileHeader) (fileBuf [][]byte, err error)
- func GenerateRedisKeyByStuId(stuId int64, sType int64) string
- func GetAvailablePort() (string, error)
- func GetDeviceID(sid int64) (datacenterid, workerid int64)
- func GetEsHost() (string, error)
- func GetGenTime(sid int64) (t string)
- func GetGenTimestamp(sid int64) (timestamp int64)
- func GetMysqlDSN() (string, error)
- func GetTimestamp(sid int64) (timestamp int64)
- func GetTimestampStatus() (state float64)
- func IsAllowImageFile(header *multipart.FileHeader) bool
- func IsSuccess(baseResp *model.BaseResp) bool
- func LoadCNLocation() *time.Location
- func MD5(str string) string
- func MD5Bytes(str []byte) string
- func ParseCookies(rawData []string) []*http.Cookie
- func ParseCookiesToString(cookies []*http.Cookie) []string
- func RetryLogin(stu *jwch.Student) error
- func SHA256(str string) string
- func SaveImageFromBytes(imgBytes []byte, format string) error
- func TimeParse(date string) (time.Time, error)
- type Claims
- type Snowflake
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
func FileToByteArray ¶
func FileToByteArray(file *multipart.FileHeader) (fileBuf [][]byte, err error)
FileToByteArray 用于将客户端发来的文件转换为[][]byte格式,用于流式传输
func GenerateRedisKeyByStuId ¶
GenerateRedisKeyByStuId 开屏页通过学号与sType生成缓存对应Key
func GetAvailablePort ¶
func GetMysqlDSN ¶
func IsAllowImageFile ¶
func IsAllowImageFile(header *multipart.FileHeader) bool
IsAllowImageFile 检查文件格式是否合规,支持jpg png jpeg格式
func ParseCookies ¶
ParseCookies 将cookie字符串解析为http.Cookie
func ParseCookiesToString ¶
func RetryLogin ¶
func SaveImageFromBytes ¶
SaveImageFromBytes 仅用于测试流式传输结果是否正确
Types ¶
type Claims ¶
type Claims struct { UserId int64 `json:"user_id"` jwt.StandardClaims }
func CheckToken ¶
Click to show internal directories.
Click to hide internal directories.