Documentation
¶
Overview ¶
Package issue1298 provides primitives to interact with the openapi HTTP API.
Code generated by github.com/jKiler/oapi-codegen version v1.0.0-00010101000000-000000000000 DO NOT EDIT.
Index ¶
- func NewTestRequestWithApplicationTestPlusJSONBody(server string, body TestApplicationTestPlusJSONRequestBody) (*http.Request, error)
- func NewTestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, ...) (*TestResponse, error)
- func (c *ClientWithResponses) TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*TestResponse, error)
- type ClientWithResponsesInterface
- type GinServerOptions
- type HttpRequestDoer
- type MiddlewareFunc
- type RequestEditorFn
- type ServerInterface
- type ServerInterfaceWrapper
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Test
- type Test204Response
- type TestApplicationTestPlusJSONRequestBody
- type TestRequestObject
- type TestResponse
- type TestResponseObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestRequestWithApplicationTestPlusJSONBody ¶
func NewTestRequestWithApplicationTestPlusJSONBody(server string, body TestApplicationTestPlusJSONRequestBody) (*http.Request, error)
NewTestRequestWithApplicationTestPlusJSONBody calls the generic Test builder with application/test+json body
func NewTestRequestWithBody ¶
func NewTestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewTestRequestWithBody generates requests for Test with any type of body
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 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) TestWithApplicationTestPlusJSONBody ¶
func (c *Client) TestWithApplicationTestPlusJSONBody(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // TestWithBody request with any body TestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) TestWithApplicationTestPlusJSONBody(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, 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) TestWithApplicationTestPlusJSONBodyWithResponse ¶
func (c *ClientWithResponses) TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*TestResponse, error)
func (*ClientWithResponses) TestWithBodyWithResponse ¶
func (c *ClientWithResponses) TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestResponse, error)
TestWithBodyWithResponse request with arbitrary body returning *TestResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // TestWithBodyWithResponse request with any body TestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TestResponse, error) TestWithApplicationTestPlusJSONBodyWithResponse(ctx context.Context, body TestApplicationTestPlusJSONRequestBody, reqEditors ...RequestEditorFn) (*TestResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type GinServerOptions ¶
type GinServerOptions struct { BaseURL string Middlewares []MiddlewareFunc ErrorHandler func(*gin.Context, error, int) }
GinServerOptions provides options for the Gin server.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type MiddlewareFunc ¶
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ServerInterface ¶
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandler func(*gin.Context, error, int) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) Test ¶
func (siw *ServerInterfaceWrapper) Test(c *gin.Context)
Test operation middleware
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictgin.StrictGinHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictgin.StrictGinMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface { // (GET /test) Test(ctx context.Context, request TestRequestObject) (TestResponseObject, error) }
StrictServerInterface represents all server handlers.
type Test204Response ¶
type Test204Response struct { }
func (Test204Response) VisitTestResponse ¶
func (response Test204Response) VisitTestResponse(w http.ResponseWriter) error
type TestApplicationTestPlusJSONRequestBody ¶
type TestApplicationTestPlusJSONRequestBody = Test
TestApplicationTestPlusJSONRequestBody defines body for Test for application/test+json ContentType.
type TestRequestObject ¶
type TestRequestObject struct {
Body *TestApplicationTestPlusJSONRequestBody
}
type TestResponse ¶
func ParseTestResponse ¶
func ParseTestResponse(rsp *http.Response) (*TestResponse, error)
ParseTestResponse parses an HTTP response from a TestWithResponse call
func (TestResponse) Status ¶
func (r TestResponse) Status() string
Status returns HTTPResponse.Status
func (TestResponse) StatusCode ¶
func (r TestResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type TestResponseObject ¶
type TestResponseObject interface {
VisitTestResponse(w http.ResponseWriter) error
}