Documentation
¶
Index ¶
- func BodyDump(ignore ...string) echo.MiddlewareFunc
- func ConvertType(sourceValue any, targetType reflect.Type) (any, error)
- func CopyMap[K comparable, V any](src map[K]V) map[K]V
- func GenerateGJWToken(password, deviceid, userid, issuer string, roles []string, ...) (string, error)
- func GenerateGJWTokenWithTime(password string, deviceid string, userid string, issuer string, roles []string, ...) (string, error)
- func GenerateRandomStr(charset string, length int) (string, error)
- func GenerateServerToken(password, systemid, userid, issuer string, roles []string, ...) (string, error)
- func GenerateServerTokenWithTime(password string, systemid string, userid string, issuer string, roles []string, ...) (string, error)
- func GetContentType(ext string) string
- func ImplementsInterface(target reflect.Type, theInterface reflect.Type) bool
- func IsArrayType(target reflect.Type) bool
- func IsConvertible(sourceValue any, targetType reflect.Type) bool
- func IsEmptyStr(target *string) bool
- func IsErrorObj(target interface{}) bool
- func IsErrorType(target reflect.Type) bool
- func IsFuncType(target reflect.Type) bool
- func IsInterfaceType(target reflect.Type) bool
- func IsPointerType(target reflect.Type) bool
- func IsStructType(target reflect.Type) bool
- func ToPtr[T interface{}](source T) *T
- func Unused(_ ...interface{})
- func ValueOrZeroOf[T interface{}](ptr *T) T
- type GJWCustomClaims
- type GJWTokenPayload
- type ServerCustomClaims
- type ServerTokenPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyDump ¶
func BodyDump(ignore ...string) echo.MiddlewareFunc
func CopyMap ¶
func CopyMap[K comparable, V any](src map[K]V) map[K]V
CopyMap returns a shallow copy of src. Returns nil if src is nil.
func GenerateGJWToken ¶
func GenerateServerToken ¶
func GetContentType ¶
func ImplementsInterface ¶
func IsArrayType ¶
func IsEmptyStr ¶
func IsErrorObj ¶
func IsErrorObj(target interface{}) bool
func IsErrorType ¶
func IsFuncType ¶
func IsInterfaceType ¶
func IsPointerType ¶
func IsStructType ¶
func Unused ¶
func Unused(_ ...interface{})
Unused is for avoiding unused variable error, in case you want to run debugging and inspect the variable value. Example:
svc := NewService(); utility.Unused(svc); // Now put breakpoint and run debugger here.
func ValueOrZeroOf ¶
func ValueOrZeroOf[T interface{}](ptr *T) T
Types ¶
type GJWCustomClaims ¶
type GJWCustomClaims struct {
UserId string `json:"userid,omitempty"`
DId string `json:"did,omitempty"`
Roles []string `json:"roles"`
jwt.RegisteredClaims
}
type GJWTokenPayload ¶
type GJWTokenPayload struct {
UserId string `json:"userid,omitempty"`
DId string `json:"did,omitempty"`
Roles []string `json:"roles"`
}
func ParseGJWToken ¶
func ParseGJWToken(tokenString string, password string) (*GJWTokenPayload, error)
type ServerCustomClaims ¶
type ServerCustomClaims struct {
SystemId string `json:"systemid"`
UserId string `json:"userid"`
Roles []string `json:"roles"`
jwt.RegisteredClaims
}
type ServerTokenPayload ¶
Click to show internal directories.
Click to hide internal directories.