Documentation
¶
Overview ¶
Package server provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Index ¶
- func NewHTTP(cfg entity.Config, router *Router) http.Handler
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type CreateJSONRequestBody
- type ErrorResponse
- type GinServerOptions
- type Id
- type LoginData
- type LoginJSONRequestBody
- type MiddlewareFunc
- type Router
- func (r *Router) Access(c *gin.Context, operationID string, id int) error
- func (r *Router) Check(c *gin.Context)
- func (r *Router) CheckAuth(c *gin.Context)
- func (r *Router) Create(c *gin.Context)
- func (r *Router) Delete(c *gin.Context, ids string)
- func (r *Router) Get(c *gin.Context, ids string)
- func (r *Router) List(c *gin.Context)
- func (r *Router) Login(c *gin.Context)
- func (r *Router) Logout(c *gin.Context)
- func (r *Router) Update(c *gin.Context, ids string)
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) Check(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Create(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Delete(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Get(c *gin.Context)
- func (siw *ServerInterfaceWrapper) List(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Login(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Logout(c *gin.Context)
- func (siw *ServerInterfaceWrapper) Update(c *gin.Context)
- type SuccessResponse
- type UpdateJSONRequestBody
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type CreateJSONRequestBody ¶
type CreateJSONRequestBody = User
CreateJSONRequestBody defines body for Create for application/json ContentType.
type ErrorResponse ¶
type ErrorResponse struct {
Error *string `json:"error,omitempty"`
}
ErrorResponse defines model for ErrorResponse.
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type LoginData ¶
type LoginData struct {
Login *string `json:"login,omitempty"`
Password *string `json:"password,omitempty"`
}
LoginData defines model for LoginData.
type LoginJSONRequestBody ¶
type LoginJSONRequestBody = LoginData
LoginJSONRequestBody defines body for Login for application/json ContentType.
type MiddlewareFunc ¶
type ServerInterface ¶
type ServerInterface interface {
// check server
// (GET /check/)
Check(c *gin.Context)
// Login and get tokens
// (POST /login/)
Login(c *gin.Context)
// Spoil tokens
// (POST /logout/)
Logout(c *gin.Context)
// User
// (GET /users/)
List(c *gin.Context)
// Create
// (POST /users/)
Create(c *gin.Context)
// Delete user
// (DELETE /users/{id}/)
Delete(c *gin.Context, id Id)
// User
// (GET /users/{id}/)
Get(c *gin.Context, id Id)
// Update user
// (PATCH /users/{id}/)
Update(c *gin.Context, id Id)
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) Check ¶
func (siw *ServerInterfaceWrapper) Check(c *gin.Context)
Check operation middleware
func (*ServerInterfaceWrapper) Create ¶
func (siw *ServerInterfaceWrapper) Create(c *gin.Context)
Create operation middleware
func (*ServerInterfaceWrapper) Delete ¶
func (siw *ServerInterfaceWrapper) Delete(c *gin.Context)
Delete operation middleware
func (*ServerInterfaceWrapper) Get ¶
func (siw *ServerInterfaceWrapper) Get(c *gin.Context)
Get operation middleware
func (*ServerInterfaceWrapper) List ¶
func (siw *ServerInterfaceWrapper) List(c *gin.Context)
List operation middleware
func (*ServerInterfaceWrapper) Login ¶
func (siw *ServerInterfaceWrapper) Login(c *gin.Context)
Login operation middleware
func (*ServerInterfaceWrapper) Logout ¶
func (siw *ServerInterfaceWrapper) Logout(c *gin.Context)
Logout operation middleware
func (*ServerInterfaceWrapper) Update ¶
func (siw *ServerInterfaceWrapper) Update(c *gin.Context)
Update operation middleware
type SuccessResponse ¶
type SuccessResponse = map[string]interface{}
SuccessResponse defines model for SuccessResponse.
type UpdateJSONRequestBody ¶
type UpdateJSONRequestBody = User
UpdateJSONRequestBody defines body for Update for application/json ContentType.