Documentation
¶
Index ¶
- func DefaultErrorHandler(err error) (status Status, response *DefaultErrorResponse)
- type Body
- type BodyInterface
- type DefaultErrorResponse
- type ErrorHandlerCaller
- type ErrorInterface
- type ErrorResponse
- type HandlerCaller
- type HandlerPanicked
- type HandlerWrapper
- type Headers
- type HeadersInterface
- type IRouter
- type IRoutes
- type Middleware
- type MiddlewareFactory
- type NotFound
- type Query
- type QueryInterface
- type Response
- type ResponseInterface
- type RootRouter
- func (g *RootRouter) Any(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) DELETE(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (r *RootRouter) Engine() http.Handler
- func (g *RootRouter) GET(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) Group(prefix string, _ ...*docs.PathDoc) IRouter
- func (g *RootRouter) HEAD(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) Handle(method string, path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) OPTIONS(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) OnError(errorHandler interface{}) IRoutes
- func (g *RootRouter) PATCH(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) POST(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) PUT(path string, handler interface{}, doc ...*docs.PathDoc) IRoutes
- func (g *RootRouter) RawRouter() gin.IRouter
- func (r *RootRouter) Run(addr string) error
- func (g *RootRouter) Use(middleware Middleware) IRoutes
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultErrorHandler ¶ added in v0.2.0
func DefaultErrorHandler(err error) (status Status, response *DefaultErrorResponse)
Types ¶
type BodyInterface ¶
type BodyInterface interface {
BodyDocs()
}
type DefaultErrorResponse ¶ added in v0.2.0
type DefaultErrorResponse struct {
ErrorResponse `status_codes:"4XX,5XX"`
Message string `json:"message"`
Details []string `json:"details"`
Success bool `json:"success"`
}
type ErrorHandlerCaller ¶ added in v0.2.0
type ErrorHandlerCaller struct {
// contains filtered or unexported fields
}
func WrapErrorHandler ¶ added in v0.2.0
func WrapErrorHandler(handler interface{}) *ErrorHandlerCaller
type ErrorInterface ¶
type ErrorInterface interface {
ErrorDocs()
}
type ErrorResponse ¶ added in v0.2.0
type ErrorResponse struct{}
func (ErrorResponse) ErrorDocs ¶ added in v0.2.0
func (m ErrorResponse) ErrorDocs()
type HandlerCaller ¶
type HandlerCaller struct {
// contains filtered or unexported fields
}
func NewHandlerCaller ¶
func NewHandlerCaller(receiver reflect.Value) *HandlerCaller
type HandlerPanicked ¶ added in v0.2.0
type HandlerPanicked struct {
Value interface{}
StackTrace []byte
}
func (*HandlerPanicked) Error ¶ added in v0.2.0
func (e *HandlerPanicked) Error() string
type HandlerWrapper ¶
type HandlerWrapper struct {
// contains filtered or unexported fields
}
func WrapHandler ¶
func WrapHandler(method string, path string, middlewares []Middleware, documentation *docs.Docs, handler, errorHandler interface{}, doc ...*docs.PathDoc) *HandlerWrapper
type HeadersInterface ¶
type HeadersInterface interface {
HeadersDocs()
}
type IRoutes ¶
type IRoutes interface {
Use(Middleware) IRoutes
Handle(string, string, interface{}, ...*docs.PathDoc) IRoutes
Any(string, interface{}, ...*docs.PathDoc) IRoutes
GET(string, interface{}, ...*docs.PathDoc) IRoutes
POST(string, interface{}, ...*docs.PathDoc) IRoutes
DELETE(string, interface{}, ...*docs.PathDoc) IRoutes
PATCH(string, interface{}, ...*docs.PathDoc) IRoutes
PUT(string, interface{}, ...*docs.PathDoc) IRoutes
OPTIONS(string, interface{}, ...*docs.PathDoc) IRoutes
HEAD(string, interface{}, ...*docs.PathDoc) IRoutes
}
type Middleware ¶
type Middleware struct {
Before interface{}
After interface{}
}
type MiddlewareFactory ¶
type MiddlewareFactory func() Middleware
type QueryInterface ¶
type QueryInterface interface {
QueryDocs()
}
type Response ¶
type Response struct{}
func (Response) ResponseDocs ¶
func (m Response) ResponseDocs()
type ResponseInterface ¶
type ResponseInterface interface {
ResponseDocs()
}
type RootRouter ¶ added in v0.2.0
type RootRouter struct {
// contains filtered or unexported fields
}
func DocumentedRouter ¶ added in v0.2.0
func DocumentedRouter(documentation *docs.Docs) *RootRouter
func Router ¶
func Router() *RootRouter
func (*RootRouter) Engine ¶ added in v0.2.0
func (r *RootRouter) Engine() http.Handler
func (*RootRouter) OnError ¶ added in v0.2.0
func (g *RootRouter) OnError(errorHandler interface{}) IRoutes
func (*RootRouter) Run ¶ added in v0.2.0
func (r *RootRouter) Run(addr string) error
func (*RootRouter) Use ¶ added in v0.2.0
func (g *RootRouter) Use(middleware Middleware) IRoutes
Source Files
¶
Click to show internal directories.
Click to hide internal directories.