registryclient

package
v0.0.0-...-0aae6f4 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	//BasicAuthScopes basic
	BasicAuthScopes = "BasicAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateuserRequest

func NewCreateuserRequest(server string, body CreateuserJSONRequestBody) (*http.Request, error)

NewCreateuserRequest calls the generic Createuser builder with application/json body

func NewCreateuserRequestWithBody

func NewCreateuserRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateuserRequestWithBody generates requests for Createuser with any type of body

func NewDeleteuserRequest

func NewDeleteuserRequest(server string, username string) (*http.Request, error)

NewDeleteuserRequest generates requests for Deleteuser

func NewGetuserRequest

func NewGetuserRequest(server string, username string) (*http.Request, error)

NewGetuserRequest generates requests for Getuser

func NewPutuserRequest

func NewPutuserRequest(server string, username string, body PutuserJSONRequestBody) (*http.Request, error)

NewPutuserRequest calls the generic Putuser builder with application/json body

func NewPutuserRequestWithBody

func NewPutuserRequestWithBody(server string, username string, contentType string, body io.Reader) (*http.Request, error)

NewPutuserRequestWithBody generates requests for Putuser with any type of body

func NewRegRequest

func NewRegRequest(server string, body RegJSONRequestBody) (*http.Request, error)

NewRegRequest calls the generic Reg builder with application/json body

func NewRegRequestWithBody

func NewRegRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewRegRequestWithBody generates requests for Reg with any type of body

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

func (c *Client) Createuser(ctx context.Context, body CreateuserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateuserWithBody

func (c *Client) CreateuserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Deleteuser

func (c *Client) Deleteuser(ctx context.Context, username string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Getuser

func (c *Client) Getuser(ctx context.Context, username string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Putuser

func (c *Client) Putuser(ctx context.Context, username string, body PutuserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PutuserWithBody

func (c *Client) PutuserWithBody(ctx context.Context, username string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) Reg

func (c *Client) Reg(ctx context.Context, body RegJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) RegWithBody

func (c *Client) RegWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// Reg request  with any body
	RegWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Reg(ctx context.Context, body RegJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Createuser request  with any body
	CreateuserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Createuser(ctx context.Context, body CreateuserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Deleteuser request
	Deleteuser(ctx context.Context, username string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Getuser request
	Getuser(ctx context.Context, username string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Putuser request  with any body
	PutuserWithBody(ctx context.Context, username string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	Putuser(ctx context.Context, username string, body PutuserJSONRequestBody, 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) CreateuserWithBodyWithResponse

func (c *ClientWithResponses) CreateuserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateuserResponse, error)

CreateuserWithBodyWithResponse request with arbitrary body returning *CreateuserResponse

func (*ClientWithResponses) CreateuserWithResponse

func (c *ClientWithResponses) CreateuserWithResponse(ctx context.Context, body CreateuserJSONRequestBody) (*CreateuserResponse, error)

func (*ClientWithResponses) DeleteuserWithResponse

func (c *ClientWithResponses) DeleteuserWithResponse(ctx context.Context, username string) (*DeleteuserResponse, error)

DeleteuserWithResponse request returning *DeleteuserResponse

func (*ClientWithResponses) GetuserWithResponse

func (c *ClientWithResponses) GetuserWithResponse(ctx context.Context, username string) (*GetuserResponse, error)

GetuserWithResponse request returning *GetuserResponse

func (*ClientWithResponses) PutuserWithBodyWithResponse

func (c *ClientWithResponses) PutuserWithBodyWithResponse(ctx context.Context, username string, contentType string, body io.Reader) (*PutuserResponse, error)

PutuserWithBodyWithResponse request with arbitrary body returning *PutuserResponse

func (*ClientWithResponses) PutuserWithResponse

func (c *ClientWithResponses) PutuserWithResponse(ctx context.Context, username string, body PutuserJSONRequestBody) (*PutuserResponse, error)

func (*ClientWithResponses) RegWithBodyWithResponse

func (c *ClientWithResponses) RegWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*RegResponse, error)

RegWithBodyWithResponse request with arbitrary body returning *RegResponse

func (*ClientWithResponses) RegWithResponse

func (c *ClientWithResponses) RegWithResponse(ctx context.Context, body RegJSONRequestBody) (*RegResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// Reg request  with any body
	RegWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*RegResponse, error)

	RegWithResponse(ctx context.Context, body RegJSONRequestBody) (*RegResponse, error)

	// Createuser request  with any body
	CreateuserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateuserResponse, error)

	CreateuserWithResponse(ctx context.Context, body CreateuserJSONRequestBody) (*CreateuserResponse, error)

	// Deleteuser request
	DeleteuserWithResponse(ctx context.Context, username string) (*DeleteuserResponse, error)

	// Getuser request
	GetuserWithResponse(ctx context.Context, username string) (*GetuserResponse, error)

	// Putuser request  with any body
	PutuserWithBodyWithResponse(ctx context.Context, username string, contentType string, body io.Reader) (*PutuserResponse, error)

	PutuserWithResponse(ctx context.Context, username string, body PutuserJSONRequestBody) (*PutuserResponse, error)
}

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

type CreateuserJSONBody

type CreateuserJSONBody FullUser

CreateuserJSONBody defines parameters for Createuser.

type CreateuserJSONRequestBody

type CreateuserJSONRequestBody CreateuserJSONBody

CreateuserJSONRequestBody defines body for Createuser for application/json ContentType.

type CreateuserResponse

type CreateuserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *User
}

func ParseCreateuserResponse

func ParseCreateuserResponse(rsp *http.Response) (*CreateuserResponse, error)

ParseCreateuserResponse parses an HTTP response from a CreateuserWithResponse call

func (CreateuserResponse) Status

func (r CreateuserResponse) Status() string

Status returns HTTPResponse.Status

func (CreateuserResponse) StatusCode

func (r CreateuserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteuserResponse

type DeleteuserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *User
}

func ParseDeleteuserResponse

func ParseDeleteuserResponse(rsp *http.Response) (*DeleteuserResponse, error)

ParseDeleteuserResponse parses an HTTP response from a DeleteuserWithResponse call

func (DeleteuserResponse) Status

func (r DeleteuserResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteuserResponse) StatusCode

func (r DeleteuserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type FullUser

type FullUser struct {
	Name     string `json:"name,omitempty"`
	Password string `json:"password,omitempty"`
	Username string `json:"username,omitempty"`
}

FullUser defines model for FullUser.

type GetuserResponse

type GetuserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *User
}

func ParseGetuserResponse

func ParseGetuserResponse(rsp *http.Response) (*GetuserResponse, error)

ParseGetuserResponse parses an HTTP response from a GetuserWithResponse call

func (GetuserResponse) Status

func (r GetuserResponse) Status() string

Status returns HTTPResponse.Status

func (GetuserResponse) StatusCode

func (r GetuserResponse) 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 PutuserJSONBody

type PutuserJSONBody FullUser

PutuserJSONBody defines parameters for Putuser.

type PutuserJSONRequestBody

type PutuserJSONRequestBody PutuserJSONBody

PutuserJSONRequestBody defines body for Putuser for application/json ContentType.

type PutuserResponse

type PutuserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *User
}

func ParsePutuserResponse

func ParsePutuserResponse(rsp *http.Response) (*PutuserResponse, error)

ParsePutuserResponse parses an HTTP response from a PutuserWithResponse call

func (PutuserResponse) Status

func (r PutuserResponse) Status() string

Status returns HTTPResponse.Status

func (PutuserResponse) StatusCode

func (r PutuserResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RegJSONBody

type RegJSONBody Registry

RegJSONBody defines parameters for Reg.

type RegJSONRequestBody

type RegJSONRequestBody RegJSONBody

RegJSONRequestBody defines body for Reg for application/json ContentType.

type RegResponse

type RegResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Registry
}

func ParseRegResponse

func ParseRegResponse(rsp *http.Response) (*RegResponse, error)

ParseRegResponse parses an HTTP response from a RegWithResponse call

func (RegResponse) Status

func (r RegResponse) Status() string

Status returns HTTPResponse.Status

func (RegResponse) StatusCode

func (r RegResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Registry

type Registry struct {
	DumpReq  []byte `json:"dump_req,omitempty"`
	DumpRes  []byte `json:"dump_res,omitempty"`
	Username string `json:"username,omitempty"`
}

Registry defines model for Registry.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type User

type User struct {
	Name     string `json:"name,omitempty"`
	Username string `json:"username,omitempty"`
}

User defines model for User.

Jump to

Keyboard shortcuts

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