param

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version (devel) DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetTestRequest

func NewGetTestRequest(server string, params *GetTestParams) (*http.Request, error)

NewGetTestRequest generates requests for GetTest

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

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

type ClientInterface

type ClientInterface interface {
	// GetTest request
	GetTest(ctx context.Context, params *GetTestParams, 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) GetTestWithResponse

func (c *ClientWithResponses) GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error)

GetTestWithResponse request returning *GetTestResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetTestWithResponse request
	GetTestWithResponse(ctx context.Context, params *GetTestParams, reqEditors ...RequestEditorFn) (*GetTestResponse, error)
}

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

type GetTestParams

type GetTestParams struct {
	Test  *Test    `form:"test,omitempty" json:"test,omitempty"`
	Test2 *[]Test2 `form:"test2,omitempty" json:"test2,omitempty"`
}

GetTestParams defines parameters for GetTest.

type GetTestResponse

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

func ParseGetTestResponse

func ParseGetTestResponse(rsp *http.Response) (*GetTestResponse, error)

ParseGetTestResponse parses an HTTP response from a GetTestWithResponse call

func (GetTestResponse) Status

func (r GetTestResponse) Status() string

Status returns HTTPResponse.Status

func (GetTestResponse) StatusCode

func (r GetTestResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type Test

type Test struct {
	// contains filtered or unexported fields
}

Test defines model for test.

func (Test) AsTest0

func (t Test) AsTest0() (Test0, error)

AsTest0 returns the union data inside the Test as a Test0

func (Test) AsTest1

func (t Test) AsTest1() (Test1, error)

AsTest1 returns the union data inside the Test as a Test1

func (*Test) FromTest0

func (t *Test) FromTest0(v Test0) error

FromTest0 overwrites any union data inside the Test as the provided Test0

func (*Test) FromTest1

func (t *Test) FromTest1(v Test1) error

FromTest1 overwrites any union data inside the Test as the provided Test1

func (Test) MarshalJSON

func (t Test) MarshalJSON() ([]byte, error)

func (*Test) MergeTest0

func (t *Test) MergeTest0(v Test0) error

MergeTest0 performs a merge with any union data inside the Test, using the provided Test0

func (*Test) MergeTest1

func (t *Test) MergeTest1(v Test1) error

MergeTest1 performs a merge with any union data inside the Test, using the provided Test1

func (*Test) UnmarshalJSON

func (t *Test) UnmarshalJSON(b []byte) error

type Test0

type Test0 struct {
	Item1 string `json:"item1"`
	Item2 string `json:"item2"`
}

Test0 defines model for .

type Test1

type Test1 struct {
	Item2 *string `json:"item2,omitempty"`
	Item3 *string `json:"item3,omitempty"`
}

Test1 defines model for .

type Test2

type Test2 struct {
	// contains filtered or unexported fields
}

Test2 defines model for test2.

func (Test2) AsTest20

func (t Test2) AsTest20() (Test20, error)

AsTest20 returns the union data inside the Test2 as a Test20

func (Test2) AsTest21

func (t Test2) AsTest21() (Test21, error)

AsTest21 returns the union data inside the Test2 as a Test21

func (*Test2) FromTest20

func (t *Test2) FromTest20(v Test20) error

FromTest20 overwrites any union data inside the Test2 as the provided Test20

func (*Test2) FromTest21

func (t *Test2) FromTest21(v Test21) error

FromTest21 overwrites any union data inside the Test2 as the provided Test21

func (Test2) MarshalJSON

func (t Test2) MarshalJSON() ([]byte, error)

func (*Test2) MergeTest20

func (t *Test2) MergeTest20(v Test20) error

MergeTest20 performs a merge with any union data inside the Test2, using the provided Test20

func (*Test2) MergeTest21

func (t *Test2) MergeTest21(v Test21) error

MergeTest21 performs a merge with any union data inside the Test2, using the provided Test21

func (*Test2) UnmarshalJSON

func (t *Test2) UnmarshalJSON(b []byte) error

type Test20

type Test20 = int

Test20 defines model for .

type Test21

type Test21 = string

Test21 defines model for .

Jump to

Keyboard shortcuts

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