Documentation ¶
Index ¶
- Constants
- func ErrorHandler() gin.HandlerFunc
- type ApiError
- type DbError
- type GinEngine
- func (e *GinEngine) AddRoute(group *gin.RouterGroup, path string, method int, handlers ...gin.HandlerFunc)
- func (e *GinEngine) NewGroup(path string, handlers ...gin.HandlerFunc) *gin.RouterGroup
- func (e *GinEngine) ServerHttp(recorder *httptest.ResponseRecorder, request *http.Request)
- func (e *GinEngine) StartServer(ctx context.Context)
- type UnauthorizedError
Constants ¶
View Source
const ( GET = iota POST PUT PATCH DELETE )
Exporting constants to avoid hardcoding these all over, and ending up with a uppercase "POST" bug in the future.
Variables ¶
This section is empty.
Functions ¶
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
Types ¶
type ApiError ¶
type GinEngine ¶
type GinEngine struct {
// contains filtered or unexported fields
}
func NewGinEngine ¶
func NewGinEngine() *GinEngine
func (*GinEngine) AddRoute ¶
func (e *GinEngine) AddRoute(group *gin.RouterGroup, path string, method int, handlers ...gin.HandlerFunc)
AddRoute Add a new endpoint mapping
func (*GinEngine) NewGroup ¶
func (e *GinEngine) NewGroup(path string, handlers ...gin.HandlerFunc) *gin.RouterGroup
func (*GinEngine) ServerHttp ¶
func (e *GinEngine) ServerHttp(recorder *httptest.ResponseRecorder, request *http.Request)
Used for unit testing
func (*GinEngine) StartServer ¶
type UnauthorizedError ¶
type UnauthorizedError struct{}
func (UnauthorizedError) Error ¶
func (unauthorized UnauthorizedError) Error() string
Click to show internal directories.
Click to hide internal directories.