Documentation ¶
Overview ¶
Package ports provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Index ¶
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type ChiServerOptions
- type CreateWalletJSONRequestBody
- type HttpServer
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
- type Wallet
- type WalletResponse
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 Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type CreateWalletJSONRequestBody ¶
type CreateWalletJSONRequestBody = Wallet
CreateWalletJSONRequestBody defines body for CreateWallet for application/json ContentType.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(application app.Application) HttpServer
func (HttpServer) CreateWallet ¶
func (s HttpServer) CreateWallet(w http.ResponseWriter, r *http.Request)
CreateWallet handles POST /v1/wallets
func (HttpServer) GetWalletById ¶
func (s HttpServer) GetWalletById(w http.ResponseWriter, r *http.Request, id string)
GetWalletById handles GET /v1/wallets/{id}
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServerInterface ¶
type ServerInterface interface { // Create a wallet // (POST /v1/wallets) CreateWallet(w http.ResponseWriter, r *http.Request) // Get wallet by ID // (GET /v1/wallets/{id}) GetWalletById(w http.ResponseWriter, r *http.Request, id string) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateWallet ¶
func (siw *ServerInterfaceWrapper) CreateWallet(w http.ResponseWriter, r *http.Request)
CreateWallet operation middleware
func (*ServerInterfaceWrapper) GetWalletById ¶
func (siw *ServerInterfaceWrapper) GetWalletById(w http.ResponseWriter, r *http.Request)
GetWalletById operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreateWallet ¶
func (_ Unimplemented) CreateWallet(w http.ResponseWriter, r *http.Request)
Create a wallet (POST /v1/wallets)
func (Unimplemented) GetWalletById ¶
func (_ Unimplemented) GetWalletById(w http.ResponseWriter, r *http.Request, id string)
Get wallet by ID (GET /v1/wallets/{id})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type WalletResponse ¶
type WalletResponse struct { Balance float32 `json:"balance"` Id string `json:"id"` Name string `json:"name"` }
WalletResponse defines model for WalletResponse.