Documentation ¶
Overview ¶
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package v1 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.
Package v1 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 GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router *gin.Engine, si ServerInterface) *gin.Engine
- func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options GinServerOptions) *gin.Engine
- type AccountOutput
- type AddAccountJSONRequestBody
- type Error
- type GinServerOptions
- type ID
- type MiddlewareFunc
- type NewAccountInput
- type ServerInterface
- type ServerInterfaceWrapper
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
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 AccountOutput ¶
type AccountOutput struct { // Balance Current account balance. The balance is represented by an integer to ensure accuracy. \ // To determine the real balance, you need to divide the current number by 100. Balance int64 `binding:"required,numeric" json:"balance"` // Comment Account comment. Comment *string `binding:"omitempty,min=0,max=255" json:"comment,omitempty"` // Disabled Account activity status. Disabled bool `binding:"required,boolean" json:"disabled"` // Id Object unique identifier. Id ID `binding:"required,min=1,max=36" json:"id"` // Name Account name. Name string `binding:"required,min=1,max=255" json:"name"` // Version Object version. Used for optimistic locking. Version Version `binding:"required,numeric,gte=0" json:"version"` }
AccountOutput defines model for AccountOutput.
type AddAccountJSONRequestBody ¶
type AddAccountJSONRequestBody = NewAccountInput
AddAccountJSONRequestBody defines body for AddAccount for application/json ContentType.
type Error ¶
type Error struct { // Code Error code. Code int8 `binding:"required,numeric,gte=0,lte=127" json:"code"` // Message Error message. Message string `binding:"required,min=1,max=4000" json:"message"` }
Error Error structure.
type GinServerOptions ¶
type GinServerOptions struct { BaseURL string Middlewares []MiddlewareFunc ErrorHandler func(*gin.Context, error, int) }
GinServerOptions provides options for the Gin server.
type MiddlewareFunc ¶
type NewAccountInput ¶
type NewAccountInput struct { // Comment Account comment. Comment *string `binding:"omitempty,min=0,max=255" json:"comment,omitempty"` // Name Account name. Name string `binding:"required,min=1,max=255" json:"name"` }
NewAccountInput Input for a new account creation.
type ServerInterface ¶
type ServerInterface interface { // (GET /api/v1/accounts) GetAllAccounts(c *gin.Context) // (POST /api/v1/accounts) AddAccount(c *gin.Context) // (GET /api/v1/accounts/{id}) FindAccountByID(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) AddAccount ¶
func (siw *ServerInterfaceWrapper) AddAccount(c *gin.Context)
AddAccount operation middleware
func (*ServerInterfaceWrapper) FindAccountByID ¶
func (siw *ServerInterfaceWrapper) FindAccountByID(c *gin.Context)
FindAccountByID operation middleware
func (*ServerInterfaceWrapper) GetAllAccounts ¶
func (siw *ServerInterfaceWrapper) GetAllAccounts(c *gin.Context)
GetAllAccounts operation middleware