Documentation
¶
Index ¶
- func Any[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func DELETE[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func Get[response any](router gin.IRoutes, path string, handler BaseHandler[response])
- func HEAD[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func Handle[request, response any](router gin.IRoutes, method, path string, handler Handler[request, response])
- func OPTIONS[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func PATCH[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func POST[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func PUT[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func SetBindHandler(f BindHandler)
- func SetErrorHandler(f ErrorHandler)
- func SetResponseHandler(f ResponseHandler)
- func UseAny[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func UseDELETE[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func UseGet[response any](router gin.IRoutes, path string, handler BaseHandler[response])
- func UseHEAD[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func UseHandle[request, response any](router gin.IRoutes, method, path string, handler Handler[request, response])
- func UseOPTIONS[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func UsePATCH[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func UsePOST[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- func UsePUT[request, response any](router gin.IRoutes, path string, handler Handler[request, response])
- type BaseContext
- type BaseHandler
- func (h BaseHandler[T]) AddMiddleware(f gin.HandlerFunc, fs ...gin.HandlerFunc) BaseHandler[T]
- func (h BaseHandler[T]) GetHandlers() []gin.HandlerFunc
- func (h BaseHandler[T]) Handler() gin.HandlerFunc
- func (h BaseHandler[T]) SetErrorHandler(f ErrorHandler) BaseHandler[T]
- func (h BaseHandler[T]) SetResponseHandler(f ResponseHandler) BaseHandler[T]
- type BaseHandlerFunc
- type BindHandler
- type Context
- type ErrorHandler
- type GetBodyHandler
- type Handler
- func (h Handler[T, E]) AddMiddleware(f gin.HandlerFunc, fs ...gin.HandlerFunc) Handler[T, E]
- func (h Handler[T, E]) GetHandlers() []gin.HandlerFunc
- func (h Handler[T, E]) Handler() gin.HandlerFunc
- func (h Handler[T, E]) SetErrorHandler(f ErrorHandler) Handler[T, E]
- func (h Handler[T, E]) SetResponseHandler(f ResponseHandler) Handler[T, E]
- type HandlerFunc
- type ResponseHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UseGet ¶
func UseGet[response any](router gin.IRoutes, path string, handler BaseHandler[response])
func UseOPTIONS ¶
Types ¶
type BaseContext ¶
type BaseHandler ¶
type BaseHandler[response any] struct { Middleware []gin.HandlerFunc ErrorHandler ErrorHandler ResponseHandler ResponseHandler HandlerFunc BaseHandlerFunc[response] }
BaseHandler 沒有 request
func NewBaseHandler ¶
func NewBaseHandler[response any](f BaseHandlerFunc[response]) BaseHandler[response]
func (BaseHandler[T]) AddMiddleware ¶
func (h BaseHandler[T]) AddMiddleware(f gin.HandlerFunc, fs ...gin.HandlerFunc) BaseHandler[T]
AddMiddleware 添加中間件
func (BaseHandler[T]) GetHandlers ¶
func (h BaseHandler[T]) GetHandlers() []gin.HandlerFunc
GetHandlers 取得 []gin.HandlerFunc
func (BaseHandler[T]) Handler ¶
func (h BaseHandler[T]) Handler() gin.HandlerFunc
Handler 處理 HandlerFunc 後 依據條件處理 ErrorHandler ResponseHandler
func (BaseHandler[T]) SetErrorHandler ¶
func (h BaseHandler[T]) SetErrorHandler(f ErrorHandler) BaseHandler[T]
SetErrorHandler 設置錯誤處理函數
func (BaseHandler[T]) SetResponseHandler ¶
func (h BaseHandler[T]) SetResponseHandler(f ResponseHandler) BaseHandler[T]
SetResponseHandler 設置回應處理函數
type Context ¶
type Context[T any] struct { BaseContext // contains filtered or unexported fields }
type ErrorHandler ¶
type GetBodyHandler ¶
type Handler ¶
type Handler[request, response any] struct { BaseHandler[response] GetBodyHandler GetBodyHandler[request] HandlerFunc HandlerFunc[request, response] }
Handler 有 request 和 response
func NewHandler ¶
func NewHandler[request, response any](f HandlerFunc[request, response]) Handler[request, response]
func (Handler[T, E]) AddMiddleware ¶
func (h Handler[T, E]) AddMiddleware(f gin.HandlerFunc, fs ...gin.HandlerFunc) Handler[T, E]
AddMiddleware 添加中間件
func (Handler[T, E]) GetHandlers ¶
func (h Handler[T, E]) GetHandlers() []gin.HandlerFunc
GetHandlers 取得 []gin.HandlerFunc
func (Handler[T, E]) Handler ¶
func (h Handler[T, E]) Handler() gin.HandlerFunc
Handler 取得 gin.HandlerFunc
func (Handler[T, E]) SetErrorHandler ¶
func (h Handler[T, E]) SetErrorHandler(f ErrorHandler) Handler[T, E]
SetErrorHandler 設置錯誤處理函數
func (Handler[T, E]) SetResponseHandler ¶
func (h Handler[T, E]) SetResponseHandler(f ResponseHandler) Handler[T, E]
SetResponseHandler 設置回應處理函數
type HandlerFunc ¶
type ResponseHandler ¶
Click to show internal directories.
Click to hide internal directories.