Documentation ¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 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 NewReadGreetingByIdRequest(server string, worldId PathWorldId, params *ReadGreetingByIdParams) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type BadRequestErrorResponse
- type BadRequestErrorResponseJSONResponse
- type ChiServerOptions
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type Error
- type GoneErrorResponse
- type GoneErrorResponseJSONResponse
- type Greeting
- type GreetingResponse
- type GreetingResponseJSONResponse
- type GreetingResponseResponseHeaders
- type HttpRequestDoer
- type InvalidParamFormatError
- type MiddlewareFunc
- type PathWorldId
- type QueryEmphasis
- type ReadGreetingById200JSONResponse
- type ReadGreetingById400JSONResponse
- type ReadGreetingById410JSONResponse
- type ReadGreetingByIdParams
- type ReadGreetingByIdRequestObject
- type ReadGreetingByIdResponse
- type ReadGreetingByIdResponseObject
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
- type WorldId
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
func NewReadGreetingByIdRequest ¶
func NewReadGreetingByIdRequest(server string, worldId PathWorldId, params *ReadGreetingByIdParams) (*http.Request, error)
NewReadGreetingByIdRequest generates requests for ReadGreetingById
Types ¶
type BadRequestErrorResponse ¶
type BadRequestErrorResponse struct {
Errors []Error `json:"errors"`
}
BadRequestErrorResponse defines model for BadRequestErrorResponse.
type BadRequestErrorResponseJSONResponse ¶
type BadRequestErrorResponseJSONResponse struct {
Errors []Error `json:"errors"`
}
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) ReadGreetingById ¶
func (c *Client) ReadGreetingById(ctx context.Context, worldId PathWorldId, params *ReadGreetingByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // ReadGreetingById request ReadGreetingById(ctx context.Context, worldId PathWorldId, params *ReadGreetingByIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) ReadGreetingByIdWithResponse ¶
func (c *ClientWithResponses) ReadGreetingByIdWithResponse(ctx context.Context, worldId PathWorldId, params *ReadGreetingByIdParams, reqEditors ...RequestEditorFn) (*ReadGreetingByIdResponse, error)
ReadGreetingByIdWithResponse request returning *ReadGreetingByIdResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // ReadGreetingByIdWithResponse request ReadGreetingByIdWithResponse(ctx context.Context, worldId PathWorldId, params *ReadGreetingByIdParams, reqEditors ...RequestEditorFn) (*ReadGreetingByIdResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Error ¶
type Error struct {
Message string `json:"message"`
}
Error The error that occured while processing this request.
type GoneErrorResponse ¶
type GoneErrorResponse struct {
Errors []Error `json:"errors"`
}
GoneErrorResponse defines model for GoneErrorResponse.
type GoneErrorResponseJSONResponse ¶
type GoneErrorResponseJSONResponse struct {
Errors []Error `json:"errors"`
}
type GreetingResponse ¶
type GreetingResponse struct { // Data Greeting to a world. Data Greeting `json:"data"` }
GreetingResponse defines model for GreetingResponse.
type GreetingResponseJSONResponse ¶
type GreetingResponseJSONResponse struct { Body struct { // Data Greeting to a world. Data Greeting `json:"data"` } Headers GreetingResponseResponseHeaders }
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ReadGreetingById200JSONResponse ¶
type ReadGreetingById200JSONResponse struct{ GreetingResponseJSONResponse }
func (ReadGreetingById200JSONResponse) VisitReadGreetingByIdResponse ¶
func (response ReadGreetingById200JSONResponse) VisitReadGreetingByIdResponse(w http.ResponseWriter) error
type ReadGreetingById400JSONResponse ¶
type ReadGreetingById400JSONResponse struct {
BadRequestErrorResponseJSONResponse
}
func (ReadGreetingById400JSONResponse) VisitReadGreetingByIdResponse ¶
func (response ReadGreetingById400JSONResponse) VisitReadGreetingByIdResponse(w http.ResponseWriter) error
type ReadGreetingById410JSONResponse ¶
type ReadGreetingById410JSONResponse struct{ GoneErrorResponseJSONResponse }
func (ReadGreetingById410JSONResponse) VisitReadGreetingByIdResponse ¶
func (response ReadGreetingById410JSONResponse) VisitReadGreetingByIdResponse(w http.ResponseWriter) error
type ReadGreetingByIdParams ¶
type ReadGreetingByIdParams struct { // Emphasis Wether to emphasis the greeting with an exclamation point. Emphasis *QueryEmphasis `form:"emphasis,omitempty" json:"emphasis,omitempty"` // FSCVWLVerwerkingsActiviteit id of the verwerking type FSCVWLVerwerkingsActiviteit *externalRef0.FSCVWLVerwerkingsActiviteit `json:"FSC-VWL-Verwerkings-Activiteit,omitempty"` // FSCVWLVerwerkingsSpan transaction uuid of the incoming request FSCVWLVerwerkingsSpan *externalRef0.FSCVWLVerwerkingsSpan `json:"FSC-VWL-Verwerkings-Span,omitempty"` // FSCVWLSysteem identifier for the system processing the verwerking FSCVWLSysteem *externalRef0.FSCVWLSysteem `json:"FSC-VWL-Systeem,omitempty"` // FSCVWLVerwerker the party doing the verwerking, this does not have to be the party responsible for the verwerking FSCVWLVerwerker *externalRef0.FSCVWLVerwerker `json:"FSC-VWL-Verwerker,omitempty"` // FSCVWLVerantwoordelijke the party responsible for the verwerking, this does not have to be the party doing the verwerking itself FSCVWLVerantwoordelijke *externalRef0.FSCVWLVerantwoordelijke `json:"FSC-VWL-Verantwoordelijke,omitempty"` }
ReadGreetingByIdParams defines parameters for ReadGreetingById.
type ReadGreetingByIdRequestObject ¶
type ReadGreetingByIdRequestObject struct { WorldId PathWorldId `json:"worldId"` Params ReadGreetingByIdParams }
type ReadGreetingByIdResponse ¶
type ReadGreetingByIdResponse struct { Body []byte HTTPResponse *http.Response JSON200 *GreetingResponse JSON400 *BadRequestErrorResponse JSON410 *GoneErrorResponse }
func ParseReadGreetingByIdResponse ¶
func ParseReadGreetingByIdResponse(rsp *http.Response) (*ReadGreetingByIdResponse, error)
ParseReadGreetingByIdResponse parses an HTTP response from a ReadGreetingByIdWithResponse call
func (ReadGreetingByIdResponse) Status ¶
func (r ReadGreetingByIdResponse) Status() string
Status returns HTTPResponse.Status
func (ReadGreetingByIdResponse) StatusCode ¶
func (r ReadGreetingByIdResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ReadGreetingByIdResponseObject ¶
type ReadGreetingByIdResponseObject interface {
VisitReadGreetingByIdResponse(w http.ResponseWriter) error
}
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
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 { // Greet a world by ID // (GET /greetings/{worldId}) ReadGreetingById(w http.ResponseWriter, r *http.Request, worldId PathWorldId, params ReadGreetingByIdParams) }
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
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) ReadGreetingById ¶
func (siw *ServerInterfaceWrapper) ReadGreetingById(w http.ResponseWriter, r *http.Request)
ReadGreetingById operation middleware
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct { RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // Greet a world by ID // (GET /greetings/{worldId}) ReadGreetingById(ctx context.Context, request ReadGreetingByIdRequestObject) (ReadGreetingByIdResponseObject, error) }
StrictServerInterface represents all server handlers.
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) ReadGreetingById ¶
func (_ Unimplemented) ReadGreetingById(w http.ResponseWriter, r *http.Request, worldId PathWorldId, params ReadGreetingByIdParams)
Greet a world by ID (GET /greetings/{worldId})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error