Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayToString(array []interface{}) string
- func AutoClearCode(filepath string, codeData string) error
- func AutoInjectionCode(filepath string, funcName string, codeData string) error
- func BcryptCheck(password, hash string) bool
- func BcryptHash(password string) string
- func BreakPointContinue(content []byte, fileName string, contentNumber int, contentTotal int, ...) (string, error)
- func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool)
- func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error
- func CreateDir(dirs ...string) (err error)
- func DeLFile(filePath string) error
- func Email(To, subject string, body string) error
- func EmailTest(subject string, body string) error
- func ErrorToEmail(subject string, body string) error
- func ExportExcel[T system.MyType](list []T) (filePath string, err error)
- func FileExist(path string) bool
- func FileMove(src string, dst string) (err error)
- func GetAddressByIp(ip string) (string, error)
- func GetClaims(c *app.RequestContext) (*systemReq.CustomClaims, error)
- func GetClaims2(c *app.RequestContext) (*systemReq.CustomClaims, error)
- func GetToken(c *app.RequestContext) (string, error)
- func GetUserAuthorityId(c *app.RequestContext) uint
- func GetUserID(c *app.RequestContext) uint
- func GetUserInfo(c *app.RequestContext) *systemReq.CustomClaims
- func GetUserUuid(c *app.RequestContext) (uuid.UUID, error)
- func GetUserUuidByToken(token string) (string, error)
- func IsToken(token string) (string, error)
- func MD5V(str []byte, b ...byte) string
- func MakeFile(fileName string, FileMd5 string) (string, error)
- func ParseDuration(d string) (time.Duration, error)
- func PathExists(path string) (bool, error)
- func Pointer[T any](in T) (out *T)
- func Reload() error
- func RemoveChunk(FileMd5 string) error
- func StructToMap(obj interface{}) map[string]interface{}
- func TrimSpace(target interface{})
- func Unzip(zipFile string, destDir string) ([]string, error)
- func ZipFiles(filename string, files []string, oldForm, newForm string) error
- type Cpu
- type Disk
- type JWT
- func (j *JWT) CreateClaims(baseClaims request.BaseClaims) request.CustomClaims
- func (j *JWT) CreateToken(claims request.CustomClaims) (string, error)
- func (j *JWT) CreateTokenByOldToken(oldToken string, claims request.CustomClaims) (string, error)
- func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error)
- type Os
- type Ram
- type Result
- type Server
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
Functions ¶
func ArrayToString ¶
func ArrayToString(array []interface{}) string
func AutoClearCode ¶
func AutoInjectionCode ¶
func BreakPointContinue ¶
func ClearTable ¶
func ErrorToEmail ¶
func GetAddressByIp ¶
func GetClaims ¶
func GetClaims(c *app.RequestContext) (*systemReq.CustomClaims, error)
func GetClaims2 ¶
func GetClaims2(c *app.RequestContext) (*systemReq.CustomClaims, error)
----------------------------------------------------
func GetUserAuthorityId ¶
func GetUserAuthorityId(c *app.RequestContext) uint
GetUserAuthorityId 从Gin的Context中获取从jwt解析出来的用户角色id
func GetUserInfo ¶
func GetUserInfo(c *app.RequestContext) *systemReq.CustomClaims
GetUserInfo 从Gin的Context中获取从jwt解析出来的用户角色id
func GetUserUuid ¶
func GetUserUuid(c *app.RequestContext) (uuid.UUID, error)
GetUserUuid 从Gin的Context中获取从jwt解析出来的用户UUID
func GetUserUuidByToken ¶
GetUserUuid 从Gin的Context中获取从jwt解析出来的用户UUID
func PathExists ¶
func RemoveChunk ¶
func StructToMap ¶
func StructToMap(obj interface{}) map[string]interface{}
Types ¶
type Disk ¶
type JWT ¶
type JWT struct {
SigningKey []byte
}
func (*JWT) CreateClaims ¶
func (j *JWT) CreateClaims(baseClaims request.BaseClaims) request.CustomClaims
func (*JWT) CreateToken ¶
func (j *JWT) CreateToken(claims request.CustomClaims) (string, error)
创建一个token
func (*JWT) CreateTokenByOldToken ¶
CreateTokenByOldToken 旧token 换新token 使用归并回源避免并发问题
func (*JWT) ParseToken ¶
func (j *JWT) ParseToken(tokenString string) (*request.CustomClaims, error)
解析 token
type Os ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.