Documentation
¶
Index ¶
- Constants
- func CORS() gin.HandlerFunc
- func DebouceAw(path ...string)
- func Debounce(duration time.Duration) gin.HandlerFunc
- func DebounceDisable()
- func DumpRouters(call func(info gin.RouteInfo))
- func FetchImage(url string) (imgData []byte, contentType, imgType string, error *errors.Error)
- func Get(baseURL string, params map[string]string) (resp string, err *errors.Error)
- func GetByCtx(ctx *gin.Context, baseURL string, params map[string]interface{}) (map[string]interface{}, *errors.Error)
- func GetClientIP(ctx *gin.Context) stringdeprecated
- func GetHeader(baseURL string, params map[string]string, header map[string]string) (resp string, err *errors.Error)
- func GetMap(baseURL string, params map[string]string) (map[string]interface{}, *errors.Error)
- func GetMapHeader(baseURL string, params map[string]string, header map[string]string) (map[string]interface{}, *errors.Error)
- func GetToken(c *gin.Context) string
- func GetTokenByCtx(c *gin.Context, mustExit bool) string
- func GetTraceID(ctx *gin.Context) stringdeprecated
- func GetUserID(ctx *gin.Context) stringdeprecated
- func GetUserIDByToken(token string) (userID string)
- func GetUserIDInt(ctx *gin.Context) intdeprecated
- func GetUserIDInt64(ctx *gin.Context) int64deprecated
- func GetUserInfo(ctx *gin.Context) map[string]interface{}deprecated
- func GetUserInfoValue(ctx *gin.Context, key string) anydeprecated
- func IsRegistered() bool
- func Logger() gin.HandlerFunc
- func NewCtx() *gin.Contextdeprecated
- func ParseJSON(jsonStr string) map[string]interface{}
- func ParseXML[T any](xmlStr string) (*T, *errors.Error)
- func PostForm(baseURL string, params map[string]string) (resp string, err *errors.Error)
- func PostJSON(baseURL string, params interface{}) (map[string]interface{}, *errors.Error)
- func PostJSONByCtx(ctx *gin.Context, baseURL string, params interface{}) (map[string]interface{}, *errors.Error)
- func PostJSONHeader(baseURL string, params interface{}, header map[string]string) (map[string]interface{}, *errors.Error)
- func PostJSONResp(baseURL string, params interface{}) (resp string, err *errors.Error)
- func PostJSONRespHeader(baseURL string, params interface{}, header map[string]string) (resp string, err *errors.Error)
- func PostXML(baseURL string, params map[string]string) (resp string, err *errors.Error)
- func Recovery() gin.HandlerFunc
- func RegisterRouter(reg func(groupRouter *gin.RouterGroup))
- func RegisterRouterMid(...) *gin.RouterGroup
- func SetTimeOutTmp(t time.Duration)
- func SetTraceID(ctx *gin.Context)deprecated
- func SetUserID(ctx *gin.Context, userID string)deprecated
- func SetUserInfo(ctx *gin.Context, userInfo map[string]interface{})deprecated
- func Shutdown(code string, ctx context.Context) error
- func SignDef() gin.HandlerFunc
- func SignRedis() gin.HandlerFunc
- func SignUserDef(userFilter map[string]interface{}) gin.HandlerFunc
- func SignUserRedis(userFilter map[string]interface{}) gin.HandlerFunc
- func Startup(code, port string) error
- type HeaderParams
- type ShardedRequestMap
Constants ¶
View Source
const ( AllowMethods = "GET, POST, PUT, DELETE, OPTIONS" AllowHeaders = "" + "Origin, " + "Content-Type, " + "Content-Length, " + "Accept-Encoding, " + "X-CSRF-Token, " + "X-Request-ID, " + "Authorization, " )
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
func CORS() gin.HandlerFunc
func DebounceDisable ¶
func DebounceDisable()
func DumpRouters ¶
func FetchImage ¶ added in v0.0.26
FetchImage fetches image from url
func GetClientIP
deprecated
func GetMapHeader ¶
func GetTraceID
deprecated
func GetUserIDByToken ¶
func GetUserIDInt
deprecated
func GetUserIDInt64
deprecated
func GetUserInfo
deprecated
func GetUserInfoValue
deprecated
func IsRegistered ¶ added in v0.0.17
func IsRegistered() bool
func Logger ¶
func Logger() gin.HandlerFunc
func PostJSONByCtx ¶
func PostJSONHeader ¶
func PostJSONResp ¶
func PostJSONRespHeader ¶
func Recovery ¶ added in v0.0.43
func Recovery() gin.HandlerFunc
func RegisterRouter ¶
func RegisterRouter(reg func(groupRouter *gin.RouterGroup))
RegisterRouter 注册路由
func RegisterRouterMid ¶
func RegisterRouterMid(group func(groupRouter *gin.RouterGroup, mid ...gin.HandlerFunc) *gin.RouterGroup, mid ...gin.HandlerFunc) *gin.RouterGroup
func SetTimeOutTmp ¶ added in v0.0.26
func SetTraceID
deprecated
func SetUserInfo
deprecated
func SignDef ¶
func SignDef() gin.HandlerFunc
func SignRedis ¶
func SignRedis() gin.HandlerFunc
func SignUserDef ¶
func SignUserDef(userFilter map[string]interface{}) gin.HandlerFunc
func SignUserRedis ¶
func SignUserRedis(userFilter map[string]interface{}) gin.HandlerFunc
Types ¶
type HeaderParams ¶
type HeaderParams struct {
Authorization string `header:"Authorization" binding:"required,min=20"`
}
type ShardedRequestMap ¶
type ShardedRequestMap struct {
// contains filtered or unexported fields
}
func NewShardedRequestMap ¶
func NewShardedRequestMap() *ShardedRequestMap
Source Files
¶
Click to show internal directories.
Click to hide internal directories.