Documentation
¶
Overview ¶
Package contracts provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type Error
- type GinServerOptions
- type Me
- type MiddlewareFunc
- type N400
- type N500
- type ServerInterface
- type ServerInterfaceWrapper
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.IRouter, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type Error ¶
type Error struct {
// Code Error code
Code int32 `json:"code"`
// Message Error
Message string `json:"message"`
}
Error defines model for Error.
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type Me ¶
type Me struct {
// SandboxID Sandbox ID
SandboxID string `json:"sandboxID"`
}
Me defines model for Me.
type MiddlewareFunc ¶
type ServerInterface ¶
type ServerInterface interface {
// (POST /logs)
Logs(c *gin.Context)
// (GET /me)
Me(c *gin.Context)
}
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) Logs ¶
func (siw *ServerInterfaceWrapper) Logs(c *gin.Context)
Logs operation middleware
func (*ServerInterfaceWrapper) Me ¶
func (siw *ServerInterfaceWrapper) Me(c *gin.Context)
Me operation middleware