Documentation
¶
Index ¶
- func Default(opts ...gin.OptionFunc) *gin.Engine
- func ErrorReturnHandler(fn errorReturnHandler) gin.HandlerFunc
- func GetSession(c *gin.Context) sessions.Session
- func GetSessionByKey(c *gin.Context, key string) sessions.Session
- func LoggerMiddleware(loggers ...plog.Logger) gin.HandlerFunc
- func LoggingRequest(header bool) gin.HandlerFunc
- func NewServerHandler() *gin.Engine
- func NewServerHandlerWithOptions(opts ...Option) *gin.Engine
- func NewSession(key string, opt StoreOption) gin.HandlerFunc
- func NewStandardServerHandler() *gin.Engine
- func ParseRequestParams(c *gin.Context, obj any) (err error)
- func RequestHandler[Q any](fn requestHandler[Q]) gin.HandlerFunc
- func RequestResponseHandler[Q any, P any](fn requestResponseHandler[Q, P]) gin.HandlerFunc
- func RequestWithErrorHandler[Q any](fn requestWithErrorHandler[Q]) gin.HandlerFunc
- func ResponseHandler[P any](fn responseHandler[P]) gin.HandlerFunc
- func ReturnError(c *gin.Context, code int, message any)
- func ReturnSuccess(c *gin.Context, data any)
- func ReuseBody() gin.HandlerFunc
- func ValidateRequestParams(obj any) (err error)
- type CookieStore
- type Error
- type MemoryStore
- type Option
- type RedisStore
- type Ret
- type Router
- type StoreOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorReturnHandler ¶
func ErrorReturnHandler(fn errorReturnHandler) gin.HandlerFunc
func LoggerMiddleware ¶
func LoggerMiddleware(loggers ...plog.Logger) gin.HandlerFunc
func LoggingRequest ¶
func LoggingRequest(header bool) gin.HandlerFunc
func NewServerHandler ¶
func NewSession ¶
func NewSession(key string, opt StoreOption) gin.HandlerFunc
func RequestHandler ¶
func RequestHandler[Q any](fn requestHandler[Q]) gin.HandlerFunc
func RequestResponseHandler ¶
func RequestResponseHandler[Q any, P any](fn requestResponseHandler[Q, P]) gin.HandlerFunc
func RequestWithErrorHandler ¶
func RequestWithErrorHandler[Q any](fn requestWithErrorHandler[Q]) gin.HandlerFunc
func ResponseHandler ¶
func ResponseHandler[P any](fn responseHandler[P]) gin.HandlerFunc
func ReturnSuccess ¶
func ReuseBody ¶
func ReuseBody() gin.HandlerFunc
func ValidateRequestParams ¶
Types ¶
type CookieStore ¶
type CookieStore struct {
// contains filtered or unexported fields
}
func InitCookieStore ¶
func InitCookieStore(keyPairs ...[]byte) *CookieStore
func (*CookieStore) GetStore ¶
func (c *CookieStore) GetStore() sessions.Store
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func InitMemStore ¶
func InitMemStore(keyPairs ...[]byte) *MemoryStore
func (*MemoryStore) GetStore ¶
func (m *MemoryStore) GetStore() sessions.Store
type Option ¶
func WithHiddenRoutesLog ¶
func WithHiddenRoutesLog() Option
func WithLoggingRequest ¶
func WithMiddlewares ¶
func WithMiddlewares(middlewares ...gin.HandlerFunc) Option
func WithReuseBody ¶
func WithReuseBody() Option
func WithRouters ¶
func WithServiceName ¶
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func InitRedisStore ¶
func InitRedisStore(pool *redis.Pool, keyPairs ...[]byte) *RedisStore
func (*RedisStore) GetStore ¶
func (r *RedisStore) GetStore() sessions.Store
type Ret ¶
type Ret struct { Code int `json:"code"` Data any `json:"data,omitempty"` Message any `json:"message,omitempty"` }
func SuccessRet ¶
type StoreOption ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.