Documentation ¶
Index ¶
- func GenerateJwtRefreshToken(secret string, duration time.Duration) (string, error)
- func GenerateJwtToken(secret string, duration time.Duration, memberId string, channel int64, ...) (string, error)
- func HttpJsonResponse(g *gin.Context, httpCode int, err error, data JsonResponse)
- func JWT() gin.HandlerFunc
- type BaseJsonResponse
- type Claims
- type HttpServer
- type JsonResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateJwtRefreshToken ¶
func GenerateJwtToken ¶
func HttpJsonResponse ¶
func HttpJsonResponse(g *gin.Context, httpCode int, err error, data JsonResponse)
返回json response
func JWT ¶
func JWT() gin.HandlerFunc
获取远程客户端ip要设置SetTrustedProxies 参考 https://www.cnblogs.com/mayanan/p/15703234.html
Types ¶
type BaseJsonResponse ¶
func (*BaseJsonResponse) SetCode ¶
func (self *BaseJsonResponse) SetCode(v int32)
func (*BaseJsonResponse) SetMsg ¶
func (self *BaseJsonResponse) SetMsg(v string)
type Claims ¶
type HttpServer ¶
func NewConfigHttpServer ¶
func NewConfigHttpServer(ctx context.Context, config gira.HttpConfig, router http.Handler) (*HttpServer, error)
func (*HttpServer) Serve ¶
func (self *HttpServer) Serve() error
func (*HttpServer) Stop ¶
func (self *HttpServer) Stop() error
type JsonResponse ¶
Click to show internal directories.
Click to hide internal directories.