Documentation
¶
Index ¶
- Constants
- type ApiHandlerFunc
- type Context
- func (c *Context) GetClientTimezoneOffset() (int16, error)
- func (c *Context) GetCurrentUid() int64
- func (c *Context) GetRequestId() string
- func (c *Context) GetResponseError() *errs.Error
- func (c *Context) GetTokenClaims() *UserTokenClaims
- func (c *Context) SetRequestId(requestId string)
- func (c *Context) SetResponseError(error *errs.Error)
- func (c *Context) SetTokenClaims(claims *UserTokenClaims)
- type DataHandlerFunc
- type MiddlewareHandlerFunc
- type TokenType
- type UserTokenClaims
Constants ¶
const ClientTimezoneOffsetHeaderName = "X-Timezone-Offset"
ClientTimezoneOffsetHeaderName represents the header name of client timezone offset
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiHandlerFunc ¶
ApiHandlerFunc represents the api handler function
type Context ¶
Context represents the request and response context
func WrapContext ¶
WrapContext returns a context wrapped by this file
func (*Context) GetClientTimezoneOffset ¶
GetClientTimezoneOffset returns the client timezone offset
func (*Context) GetCurrentUid ¶
GetCurrentUid returns the current user uid by the current user token
func (*Context) GetRequestId ¶
GetRequestId returns the current request id
func (*Context) GetResponseError ¶
GetResponseError returns the response error
func (*Context) GetTokenClaims ¶
func (c *Context) GetTokenClaims() *UserTokenClaims
GetTokenClaims returns the current user token
func (*Context) SetRequestId ¶
SetRequestId sets the given request id to context
func (*Context) SetResponseError ¶
SetResponseError sets the response error
func (*Context) SetTokenClaims ¶
func (c *Context) SetTokenClaims(claims *UserTokenClaims)
SetTokenClaims sets the given user token id to context
type DataHandlerFunc ¶
DataHandlerFunc represents the handler function that returns byte array
type MiddlewareHandlerFunc ¶
type MiddlewareHandlerFunc func(*Context)
MiddlewareHandlerFunc represents the middleware handler function
type UserTokenClaims ¶
type UserTokenClaims struct {
UserTokenId string `json:"userTokenId"`
Username string `json:"username,omitempty"`
Type TokenType `json:"type"`
jwt.StandardClaims
}
UserTokenClaims represents user token