api

package module
v0.0.0-...-f49872d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: EUPL-1.2 Imports: 15 Imported by: 0

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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 NewPostVWLRequest

func NewPostVWLRequest(server string, params *PostVWLParams) (*http.Request, error)

NewPostVWLRequest generates requests for PostVWL

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

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) PostVWL

func (c *Client) PostVWL(ctx context.Context, params *PostVWLParams, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// PostVWL request
	PostVWL(ctx context.Context, params *PostVWLParams, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

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) PostVWLWithResponse

func (c *ClientWithResponses) PostVWLWithResponse(ctx context.Context, params *PostVWLParams, reqEditors ...RequestEditorFn) (*PostVWLResponse, error)

PostVWLWithResponse request returning *PostVWLResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostVWLWithResponse request
	PostVWLWithResponse(ctx context.Context, params *PostVWLParams, reqEditors ...RequestEditorFn) (*PostVWLResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type FSCVWLSysteem

type FSCVWLSysteem = string

FSCVWLSysteem defines model for FSCVWLSysteem.

type FSCVWLVerantwoordelijke

type FSCVWLVerantwoordelijke = string

FSCVWLVerantwoordelijke defines model for FSCVWLVerantwoordelijke.

type FSCVWLVerwerker

type FSCVWLVerwerker = string

FSCVWLVerwerker defines model for FSCVWLVerwerker.

type FSCVWLVerwerkingsActiviteit

type FSCVWLVerwerkingsActiviteit = string

FSCVWLVerwerkingsActiviteit defines model for FSCVWLVerwerkingsActiviteit.

type FSCVWLVerwerkingsSpan

type FSCVWLVerwerkingsSpan = openapi_types.UUID

FSCVWLVerwerkingsSpan defines model for FSCVWLVerwerkingsSpan.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PostVWL200Response

type PostVWL200Response struct {
}

func (PostVWL200Response) VisitPostVWLResponse

func (response PostVWL200Response) VisitPostVWLResponse(w http.ResponseWriter) error

type PostVWLParams

type PostVWLParams struct {
	// FSCVWLVerwerkingsActiviteit id of the verwerking type
	FSCVWLVerwerkingsActiviteit *FSCVWLVerwerkingsActiviteit `json:"FSC-VWL-Verwerkings-Activiteit,omitempty"`

	// FSCVWLVerwerkingsSpan transaction uuid of the incoming request
	FSCVWLVerwerkingsSpan *FSCVWLVerwerkingsSpan `json:"FSC-VWL-Verwerkings-Span,omitempty"`

	// FSCVWLSysteem identifier for the system processing the verwerking
	FSCVWLSysteem *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 *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 *FSCVWLVerantwoordelijke `json:"FSC-VWL-Verantwoordelijke,omitempty"`
}

PostVWLParams defines parameters for PostVWL.

type PostVWLRequestObject

type PostVWLRequestObject struct {
	Params PostVWLParams
}

type PostVWLResponse

type PostVWLResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParsePostVWLResponse

func ParsePostVWLResponse(rsp *http.Response) (*PostVWLResponse, error)

ParsePostVWLResponse parses an HTTP response from a PostVWLWithResponse call

func (PostVWLResponse) Status

func (r PostVWLResponse) Status() string

Status returns HTTPResponse.Status

func (PostVWLResponse) StatusCode

func (r PostVWLResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostVWLResponseObject

type PostVWLResponseObject interface {
	VisitPostVWLResponse(w http.ResponseWriter) error
}

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

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 {

	// (POST /VWL)
	PostVWL(w http.ResponseWriter, r *http.Request, params PostVWLParams)
}

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) PostVWL

PostVWL 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 StrictServerInterface

type StrictServerInterface interface {

	// (POST /VWL)
	PostVWL(ctx context.Context, request PostVWLRequestObject) (PostVWLResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) PostVWL

func (_ Unimplemented) PostVWL(w http.ResponseWriter, r *http.Request, params PostVWLParams)

(POST /VWL)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL