client

package
v0.0.0-...-cab0a5a Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDownloadPatchArchiveFileRequest

func NewDownloadPatchArchiveFileRequest(server string, patchID string, artifactName string) (*http.Request, error)

NewDownloadPatchArchiveFileRequest generates requests for DownloadPatchArchiveFile

func NewDownloadPatchArchiveRequest

func NewDownloadPatchArchiveRequest(server string, patchID string) (*http.Request, error)

NewDownloadPatchArchiveRequest generates requests for DownloadPatchArchive

func NewGetAvailablePatchEnvelopesRequest

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

NewGetAvailablePatchEnvelopesRequest generates requests for GetAvailablePatchEnvelopes

func NewPostOpaqueStatusRequest

func NewPostOpaqueStatusRequest(server string, body PostOpaqueStatusJSONRequestBody) (*http.Request, error)

NewPostOpaqueStatusRequest calls the generic PostOpaqueStatus builder with application/json body

func NewPostOpaqueStatusRequestWithBody

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

NewPostOpaqueStatusRequestWithBody generates requests for PostOpaqueStatus with any type of body

Types

type BinaryBlob

type BinaryBlob struct {
	// ArtifactMetaData base64-encoded generic metadata, i.e. user info, description, etc.
	ArtifactMetaData *string `json:"artifactMetaData,omitempty"`

	// FileMetaData base64-encoded metadata related to file, i.e. env variables, cli arguments
	FileMetaData *string `json:"fileMetaData,omitempty"`

	// FileName Name of binary artifact
	FileName *string `json:"fileName,omitempty"`

	// FileSha SHA-256 of the binary artifact
	FileSha *string `json:"fileSha,omitempty"`

	// Size size of binary artifact in bytes
	Size *int `json:"size,omitempty"`

	// Url URL to download this binary artifact
	Url *string `json:"url,omitempty"`
}

BinaryBlob Binary blobs (or artifacts) are the files exposed to app instance through patch envelope. They are treated as files, each entry contains artifact name, it's SHA and size, metadata related to file, user info. Also it has URL to download this file.

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

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

func (*Client) DownloadPatchArchiveFile

func (c *Client) DownloadPatchArchiveFile(ctx context.Context, patchID string, artifactName string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetAvailablePatchEnvelopes

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

func (*Client) PostOpaqueStatus

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

func (*Client) PostOpaqueStatusWithBody

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

type ClientInterface

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

	PostOpaqueStatus(ctx context.Context, body PostOpaqueStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

	// DownloadPatchArchiveFile request
	DownloadPatchArchiveFile(ctx context.Context, patchID string, artifactName string, 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) DownloadPatchArchiveFileWithResponse

func (c *ClientWithResponses) DownloadPatchArchiveFileWithResponse(ctx context.Context, patchID string, artifactName string, reqEditors ...RequestEditorFn) (*DownloadPatchArchiveFileResponse, error)

DownloadPatchArchiveFileWithResponse request returning *DownloadPatchArchiveFileResponse

func (*ClientWithResponses) DownloadPatchArchiveWithResponse

func (c *ClientWithResponses) DownloadPatchArchiveWithResponse(ctx context.Context, patchID string, reqEditors ...RequestEditorFn) (*DownloadPatchArchiveResponse, error)

DownloadPatchArchiveWithResponse request returning *DownloadPatchArchiveResponse

func (*ClientWithResponses) GetAvailablePatchEnvelopesWithResponse

func (c *ClientWithResponses) GetAvailablePatchEnvelopesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAvailablePatchEnvelopesResponse, error)

GetAvailablePatchEnvelopesWithResponse request returning *GetAvailablePatchEnvelopesResponse

func (*ClientWithResponses) PostOpaqueStatusWithBodyWithResponse

func (c *ClientWithResponses) PostOpaqueStatusWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOpaqueStatusResponse, error)

PostOpaqueStatusWithBodyWithResponse request with arbitrary body returning *PostOpaqueStatusResponse

func (*ClientWithResponses) PostOpaqueStatusWithResponse

func (c *ClientWithResponses) PostOpaqueStatusWithResponse(ctx context.Context, body PostOpaqueStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOpaqueStatusResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// PostOpaqueStatusWithBodyWithResponse request with any body
	PostOpaqueStatusWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOpaqueStatusResponse, error)

	PostOpaqueStatusWithResponse(ctx context.Context, body PostOpaqueStatusJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOpaqueStatusResponse, error)

	// GetAvailablePatchEnvelopesWithResponse request
	GetAvailablePatchEnvelopesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAvailablePatchEnvelopesResponse, error)

	// DownloadPatchArchiveWithResponse request
	DownloadPatchArchiveWithResponse(ctx context.Context, patchID string, reqEditors ...RequestEditorFn) (*DownloadPatchArchiveResponse, error)

	// DownloadPatchArchiveFileWithResponse request
	DownloadPatchArchiveFileWithResponse(ctx context.Context, patchID string, artifactName string, reqEditors ...RequestEditorFn) (*DownloadPatchArchiveFileResponse, error)
}

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

type DownloadPatchArchiveFileResponse

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

func ParseDownloadPatchArchiveFileResponse

func ParseDownloadPatchArchiveFileResponse(rsp *http.Response) (*DownloadPatchArchiveFileResponse, error)

ParseDownloadPatchArchiveFileResponse parses an HTTP response from a DownloadPatchArchiveFileWithResponse call

func (DownloadPatchArchiveFileResponse) Status

Status returns HTTPResponse.Status

func (DownloadPatchArchiveFileResponse) StatusCode

func (r DownloadPatchArchiveFileResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DownloadPatchArchiveResponse

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

func ParseDownloadPatchArchiveResponse

func ParseDownloadPatchArchiveResponse(rsp *http.Response) (*DownloadPatchArchiveResponse, error)

ParseDownloadPatchArchiveResponse parses an HTTP response from a DownloadPatchArchiveWithResponse call

func (DownloadPatchArchiveResponse) Status

Status returns HTTPResponse.Status

func (DownloadPatchArchiveResponse) StatusCode

func (r DownloadPatchArchiveResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetAvailablePatchEnvelopesResponse

type GetAvailablePatchEnvelopesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *[]PatchEnvelopeDescription
}

func ParseGetAvailablePatchEnvelopesResponse

func ParseGetAvailablePatchEnvelopesResponse(rsp *http.Response) (*GetAvailablePatchEnvelopesResponse, error)

ParseGetAvailablePatchEnvelopesResponse parses an HTTP response from a GetAvailablePatchEnvelopesWithResponse call

func (GetAvailablePatchEnvelopesResponse) Status

Status returns HTTPResponse.Status

func (GetAvailablePatchEnvelopesResponse) StatusCode

func (r GetAvailablePatchEnvelopesResponse) 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 OpaqueStatus

type OpaqueStatus struct {
	Status *[]byte `json:"status,omitempty"`
}

OpaqueStatus Opaque status to send back to controller

type PatchEnvelopeDescription

type PatchEnvelopeDescription struct {
	BinaryBlobs *[]BinaryBlob `json:"BinaryBlobs,omitempty"`

	// PatchID Unique identifier of patch envelope
	PatchID *string `json:"PatchID,omitempty"`

	// Version Version of patch envelope
	Version *string `json:"Version,omitempty"`
}

PatchEnvelopeDescription Patch envelope contains of artifacts (binary blobs) which could be anything you want (configuration files, binary executables, dynamic libraries, etc.)

type PostOpaqueStatusJSONRequestBody

type PostOpaqueStatusJSONRequestBody = OpaqueStatus

PostOpaqueStatusJSONRequestBody defines body for PostOpaqueStatus for application/json ContentType.

type PostOpaqueStatusResponse

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

func ParsePostOpaqueStatusResponse

func ParsePostOpaqueStatusResponse(rsp *http.Response) (*PostOpaqueStatusResponse, error)

ParsePostOpaqueStatusResponse parses an HTTP response from a PostOpaqueStatusWithResponse call

func (PostOpaqueStatusResponse) Status

func (r PostOpaqueStatusResponse) Status() string

Status returns HTTPResponse.Status

func (PostOpaqueStatusResponse) StatusCode

func (r PostOpaqueStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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