generate

package
v0.0.0-...-547473f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateLoadBalancerRequest

func NewCreateLoadBalancerRequest(server string, name Name, body CreateLoadBalancerJSONRequestBody) (*http.Request, error)

NewCreateLoadBalancerRequest calls the generic CreateLoadBalancer builder with application/json body

func NewCreateLoadBalancerRequestWithBody

func NewCreateLoadBalancerRequestWithBody(server string, name Name, contentType string, body io.Reader) (*http.Request, error)

NewCreateLoadBalancerRequestWithBody generates requests for CreateLoadBalancer with any type of body

func NewDeleteLoadBalancerRequest

func NewDeleteLoadBalancerRequest(server string, name Name) (*http.Request, error)

NewDeleteLoadBalancerRequest generates requests for DeleteLoadBalancer

func NewGetHealthRequest

func NewGetHealthRequest(server string) (*http.Request, error)

NewGetHealthRequest generates requests for GetHealth

func NewGetLoadbalancerRequest

func NewGetLoadbalancerRequest(server string, name Name) (*http.Request, error)

NewGetLoadbalancerRequest generates requests for GetLoadbalancer

func NewGetLoadbalancersRequest

func NewGetLoadbalancersRequest(server string) (*http.Request, error)

NewGetLoadbalancersRequest generates requests for GetLoadbalancers

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 Backend

type Backend struct {
	HealthCheckNodePort *int     `json:"health_check_node_port,omitempty"`
	Server              []string `json:"server"`
}

Backend defines model for backend.

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

func (c *Client) CreateLoadBalancer(ctx context.Context, name Name, body CreateLoadBalancerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateLoadBalancerWithBody

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

func (*Client) DeleteLoadBalancer

func (c *Client) DeleteLoadBalancer(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetHealth

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

func (*Client) GetLoadbalancer

func (c *Client) GetLoadbalancer(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLoadbalancers

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

type ClientInterface

type ClientInterface interface {
	// GetHealth request
	GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLoadbalancers request
	GetLoadbalancers(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteLoadBalancer request
	DeleteLoadBalancer(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLoadbalancer request
	GetLoadbalancer(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateLoadBalancer request with any body
	CreateLoadBalancerWithBody(ctx context.Context, name Name, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateLoadBalancer(ctx context.Context, name Name, body CreateLoadBalancerJSONRequestBody, 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) CreateLoadBalancerWithBodyWithResponse

func (c *ClientWithResponses) CreateLoadBalancerWithBodyWithResponse(ctx context.Context, name Name, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateLoadBalancerResponse, error)

CreateLoadBalancerWithBodyWithResponse request with arbitrary body returning *CreateLoadBalancerResponse

func (*ClientWithResponses) CreateLoadBalancerWithResponse

func (c *ClientWithResponses) CreateLoadBalancerWithResponse(ctx context.Context, name Name, body CreateLoadBalancerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLoadBalancerResponse, error)

func (*ClientWithResponses) DeleteLoadBalancerWithResponse

func (c *ClientWithResponses) DeleteLoadBalancerWithResponse(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*DeleteLoadBalancerResponse, error)

DeleteLoadBalancerWithResponse request returning *DeleteLoadBalancerResponse

func (*ClientWithResponses) GetHealthWithResponse

func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

GetHealthWithResponse request returning *GetHealthResponse

func (*ClientWithResponses) GetLoadbalancerWithResponse

func (c *ClientWithResponses) GetLoadbalancerWithResponse(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*GetLoadbalancerResponse, error)

GetLoadbalancerWithResponse request returning *GetLoadbalancerResponse

func (*ClientWithResponses) GetLoadbalancersWithResponse

func (c *ClientWithResponses) GetLoadbalancersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLoadbalancersResponse, error)

GetLoadbalancersWithResponse request returning *GetLoadbalancersResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetHealth request
	GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

	// GetLoadbalancers request
	GetLoadbalancersWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLoadbalancersResponse, error)

	// DeleteLoadBalancer request
	DeleteLoadBalancerWithResponse(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*DeleteLoadBalancerResponse, error)

	// GetLoadbalancer request
	GetLoadbalancerWithResponse(ctx context.Context, name Name, reqEditors ...RequestEditorFn) (*GetLoadbalancerResponse, error)

	// CreateLoadBalancer request with any body
	CreateLoadBalancerWithBodyWithResponse(ctx context.Context, name Name, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateLoadBalancerResponse, error)

	CreateLoadBalancerWithResponse(ctx context.Context, name Name, body CreateLoadBalancerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLoadBalancerResponse, error)
}

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

type Config

type Config struct {
	Frontends []Frontend `json:"frontends"`
}

Config defines model for config.

type CreateLoadBalancerJSONBody

type CreateLoadBalancerJSONBody = Loadbalancer

CreateLoadBalancerJSONBody defines parameters for CreateLoadBalancer.

type CreateLoadBalancerJSONRequestBody

type CreateLoadBalancerJSONRequestBody = CreateLoadBalancerJSONBody

CreateLoadBalancerJSONRequestBody defines body for CreateLoadBalancer for application/json ContentType.

type CreateLoadBalancerResponse

type CreateLoadBalancerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Loadbalancer
	JSONDefault  *Error
}

func ParseCreateLoadBalancerResponse

func ParseCreateLoadBalancerResponse(rsp *http.Response) (*CreateLoadBalancerResponse, error)

ParseCreateLoadBalancerResponse parses an HTTP response from a CreateLoadBalancerWithResponse call

func (CreateLoadBalancerResponse) Status

Status returns HTTPResponse.Status

func (CreateLoadBalancerResponse) StatusCode

func (r CreateLoadBalancerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteLoadBalancerResponse

type DeleteLoadBalancerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseDeleteLoadBalancerResponse

func ParseDeleteLoadBalancerResponse(rsp *http.Response) (*DeleteLoadBalancerResponse, error)

ParseDeleteLoadBalancerResponse parses an HTTP response from a DeleteLoadBalancerWithResponse call

func (DeleteLoadBalancerResponse) Status

Status returns HTTPResponse.Status

func (DeleteLoadBalancerResponse) StatusCode

func (r DeleteLoadBalancerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

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 Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Error defines model for error.

type Frontend

type Frontend struct {
	Backend Backend `json:"backend"`
	Port    int     `json:"port"`
}

Frontend defines model for frontend.

type GetHealthResponse

type GetHealthResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSONDefault  *Error
}

func ParseGetHealthResponse

func ParseGetHealthResponse(rsp *http.Response) (*GetHealthResponse, error)

ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call

func (GetHealthResponse) Status

func (r GetHealthResponse) Status() string

Status returns HTTPResponse.Status

func (GetHealthResponse) StatusCode

func (r GetHealthResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLoadbalancerResponse

type GetLoadbalancerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Loadbalancer
	JSONDefault  *Error
}

func ParseGetLoadbalancerResponse

func ParseGetLoadbalancerResponse(rsp *http.Response) (*GetLoadbalancerResponse, error)

ParseGetLoadbalancerResponse parses an HTTP response from a GetLoadbalancerWithResponse call

func (GetLoadbalancerResponse) Status

func (r GetLoadbalancerResponse) Status() string

Status returns HTTPResponse.Status

func (GetLoadbalancerResponse) StatusCode

func (r GetLoadbalancerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLoadbalancersResponse

type GetLoadbalancersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]Loadbalancer
	JSONDefault  *Error
}

func ParseGetLoadbalancersResponse

func ParseGetLoadbalancersResponse(rsp *http.Response) (*GetLoadbalancersResponse, error)

ParseGetLoadbalancersResponse parses an HTTP response from a GetLoadbalancersWithResponse call

func (GetLoadbalancersResponse) Status

func (r GetLoadbalancersResponse) Status() string

Status returns HTTPResponse.Status

func (GetLoadbalancersResponse) StatusCode

func (r GetLoadbalancersResponse) 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 Loadbalancer

type Loadbalancer struct {
	Config Config  `json:"config"`
	Name   *string `json:"name,omitempty"`
	Status *Status `json:"status,omitempty"`
}

Loadbalancer defines model for loadbalancer.

type Name

type Name = string

Name defines model for name.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ServerInterface

type ServerInterface interface {

	// (GET /healthz)
	GetHealth(ctx echo.Context) error

	// (GET /loadbalancers)
	GetLoadbalancers(ctx echo.Context) error

	// (DELETE /loadbalancers/{name})
	DeleteLoadBalancer(ctx echo.Context, name Name) error

	// (GET /loadbalancers/{name})
	GetLoadbalancer(ctx echo.Context, name Name) error

	// (PUT /loadbalancers/{name})
	CreateLoadBalancer(ctx echo.Context, name Name) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) CreateLoadBalancer

func (w *ServerInterfaceWrapper) CreateLoadBalancer(ctx echo.Context) error

CreateLoadBalancer converts echo context to params.

func (*ServerInterfaceWrapper) DeleteLoadBalancer

func (w *ServerInterfaceWrapper) DeleteLoadBalancer(ctx echo.Context) error

DeleteLoadBalancer converts echo context to params.

func (*ServerInterfaceWrapper) GetHealth

func (w *ServerInterfaceWrapper) GetHealth(ctx echo.Context) error

GetHealth converts echo context to params.

func (*ServerInterfaceWrapper) GetLoadbalancer

func (w *ServerInterfaceWrapper) GetLoadbalancer(ctx echo.Context) error

GetLoadbalancer converts echo context to params.

func (*ServerInterfaceWrapper) GetLoadbalancers

func (w *ServerInterfaceWrapper) GetLoadbalancers(ctx echo.Context) error

GetLoadbalancers converts echo context to params.

type Status

type Status struct {
	Hostname *string `json:"hostname,omitempty"`
	Ip       *string `json:"ip,omitempty"`
}

Status defines model for status.

Jump to

Keyboard shortcuts

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