Documentation
¶
Overview ¶
Package param 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 GetSwagger() (swagger *openapi3.T, err error)
- func NewTestRequest(server string) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type EchoRouter
- type HttpRequestDoer
- type RequestEditorFn
- type ServerInterface
- type ServerInterfaceWrapper
- type Test
- type TestFieldA0
- type TestFieldA1
- type TestFieldB
- type TestFieldC0
- type TestFieldC1
- type TestResponse
- type Test_FieldA
- func (t Test_FieldA) AsTestFieldA0() (TestFieldA0, error)
- func (t Test_FieldA) AsTestFieldA1() (TestFieldA1, error)
- func (t *Test_FieldA) FromTestFieldA0(v TestFieldA0) error
- func (t *Test_FieldA) FromTestFieldA1(v TestFieldA1) error
- func (t Test_FieldA) MarshalJSON() ([]byte, error)
- func (t *Test_FieldA) MergeTestFieldA0(v TestFieldA0) error
- func (t *Test_FieldA) MergeTestFieldA1(v TestFieldA1) error
- func (t *Test_FieldA) UnmarshalJSON(b []byte) error
- type Test_FieldC
- func (t Test_FieldC) AsTestFieldC0() (TestFieldC0, error)
- func (t Test_FieldC) AsTestFieldC1() (TestFieldC1, error)
- func (t *Test_FieldC) FromTestFieldC0(v TestFieldC0) error
- func (t *Test_FieldC) FromTestFieldC1(v TestFieldC1) error
- func (t Test_FieldC) MarshalJSON() ([]byte, error)
- func (t *Test_FieldC) MergeTestFieldC0(v TestFieldC0) error
- func (t *Test_FieldC) MergeTestFieldC1(v TestFieldC1) error
- func (t *Test_FieldC) UnmarshalJSON(b []byte) error
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 NewTestRequest ¶
NewTestRequest generates requests for Test
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
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.
type ClientInterface ¶
type ClientInterface interface {
// Test request
Test(ctx context.Context, 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) TestWithResponse ¶
func (c *ClientWithResponses) TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error)
TestWithResponse request returning *TestResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// TestWithResponse request
TestWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*TestResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ServerInterface ¶
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
type Test ¶
type Test struct {
FieldA *Test_FieldA `json:"fieldA,omitempty"`
FieldB *TestFieldB `json:"fieldB,omitempty"`
FieldC *Test_FieldC `json:"fieldC,omitempty"`
}
Test defines model for test.
type TestFieldA1 ¶
type TestFieldA1 string
TestFieldA1 defines model for Test.FieldA.1.
const ( TestFieldA1Bar TestFieldA1 = "bar" TestFieldA1Foo TestFieldA1 = "foo" )
Defines values for TestFieldA1.
type TestFieldB ¶
type TestFieldB string
TestFieldB defines model for Test.FieldB.
const ( TestFieldBBar TestFieldB = "bar" TestFieldBFoo TestFieldB = "foo" )
Defines values for TestFieldB.
type TestFieldC1 ¶
type TestFieldC1 string
TestFieldC1 defines model for Test.FieldC.1.
const ( Bar TestFieldC1 = "bar" Foo TestFieldC1 = "foo" )
Defines values for TestFieldC1.
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 Test_FieldA ¶
type Test_FieldA struct {
// contains filtered or unexported fields
}
Test_FieldA defines model for Test.FieldA.
func (Test_FieldA) AsTestFieldA0 ¶
func (t Test_FieldA) AsTestFieldA0() (TestFieldA0, error)
AsTestFieldA0 returns the union data inside the Test_FieldA as a TestFieldA0
func (Test_FieldA) AsTestFieldA1 ¶
func (t Test_FieldA) AsTestFieldA1() (TestFieldA1, error)
AsTestFieldA1 returns the union data inside the Test_FieldA as a TestFieldA1
func (*Test_FieldA) FromTestFieldA0 ¶
func (t *Test_FieldA) FromTestFieldA0(v TestFieldA0) error
FromTestFieldA0 overwrites any union data inside the Test_FieldA as the provided TestFieldA0
func (*Test_FieldA) FromTestFieldA1 ¶
func (t *Test_FieldA) FromTestFieldA1(v TestFieldA1) error
FromTestFieldA1 overwrites any union data inside the Test_FieldA as the provided TestFieldA1
func (Test_FieldA) MarshalJSON ¶
func (t Test_FieldA) MarshalJSON() ([]byte, error)
func (*Test_FieldA) MergeTestFieldA0 ¶
func (t *Test_FieldA) MergeTestFieldA0(v TestFieldA0) error
MergeTestFieldA0 performs a merge with any union data inside the Test_FieldA, using the provided TestFieldA0
func (*Test_FieldA) MergeTestFieldA1 ¶
func (t *Test_FieldA) MergeTestFieldA1(v TestFieldA1) error
MergeTestFieldA1 performs a merge with any union data inside the Test_FieldA, using the provided TestFieldA1
func (*Test_FieldA) UnmarshalJSON ¶
func (t *Test_FieldA) UnmarshalJSON(b []byte) error
type Test_FieldC ¶
type Test_FieldC struct {
// contains filtered or unexported fields
}
Test_FieldC defines model for Test.FieldC.
func (Test_FieldC) AsTestFieldC0 ¶
func (t Test_FieldC) AsTestFieldC0() (TestFieldC0, error)
AsTestFieldC0 returns the union data inside the Test_FieldC as a TestFieldC0
func (Test_FieldC) AsTestFieldC1 ¶
func (t Test_FieldC) AsTestFieldC1() (TestFieldC1, error)
AsTestFieldC1 returns the union data inside the Test_FieldC as a TestFieldC1
func (*Test_FieldC) FromTestFieldC0 ¶
func (t *Test_FieldC) FromTestFieldC0(v TestFieldC0) error
FromTestFieldC0 overwrites any union data inside the Test_FieldC as the provided TestFieldC0
func (*Test_FieldC) FromTestFieldC1 ¶
func (t *Test_FieldC) FromTestFieldC1(v TestFieldC1) error
FromTestFieldC1 overwrites any union data inside the Test_FieldC as the provided TestFieldC1
func (Test_FieldC) MarshalJSON ¶
func (t Test_FieldC) MarshalJSON() ([]byte, error)
func (*Test_FieldC) MergeTestFieldC0 ¶
func (t *Test_FieldC) MergeTestFieldC0(v TestFieldC0) error
MergeTestFieldC0 performs a merge with any union data inside the Test_FieldC, using the provided TestFieldC0
func (*Test_FieldC) MergeTestFieldC1 ¶
func (t *Test_FieldC) MergeTestFieldC1(v TestFieldC1) error
MergeTestFieldC1 performs a merge with any union data inside the Test_FieldC, using the provided TestFieldC1
func (*Test_FieldC) UnmarshalJSON ¶
func (t *Test_FieldC) UnmarshalJSON(b []byte) error