envdapi

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetEnvsRequest

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

NewGetEnvsRequest constructs an http.Request for the GetEnvs method

func NewGetFilesRequest

func NewGetFilesRequest(server string, params *GetFilesParams) (*http.Request, error)

NewGetFilesRequest constructs an http.Request for the GetFiles method

func NewGetHealthRequest

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

NewGetHealthRequest constructs an http.Request for the GetHealth method

func NewGetMetricsRequest

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

NewGetMetricsRequest constructs an http.Request for the GetMetrics method

func NewPostFilesComposeRequest added in v0.1.4

func NewPostFilesComposeRequest(server string, body PostFilesComposeJSONRequestBody) (*http.Request, error)

NewPostFilesComposeRequest calls the generic PostFilesCompose builder with application/json body

func NewPostFilesComposeRequestWithBody added in v0.1.4

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

NewPostFilesComposeRequestWithBody constructs an http.Request for the PostFilesCompose method, with any body, and a specified content type

func NewPostFilesRequestWithBody

func NewPostFilesRequestWithBody(server string, params *PostFilesParams, contentType string, body io.Reader) (*http.Request, error)

NewPostFilesRequestWithBody constructs an http.Request for the PostFiles method, with any body, and a specified content type

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

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

GetEnvs Environment variables

Corresponds with GET /envs (the `GetEnvs` operationId).

func (*Client) GetFiles

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

GetFiles Download a file

Corresponds with GET /files (the `GetFiles` operationId).

func (*Client) GetHealth

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

GetHealth Check the health of the service

Corresponds with GET /health (the `GetHealth` operationId).

func (*Client) GetMetrics

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

GetMetrics Service stats

Corresponds with GET /metrics (the `GetMetrics` operationId).

func (*Client) PostFilesCompose added in v0.1.4

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

PostFilesCompose Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.

Takes a body of the `application/json` content type.

Corresponds with POST /files/compose (the `PostFilesCompose` operationId).

func (*Client) PostFilesComposeWithBody added in v0.1.4

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

PostFilesComposeWithBody Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.

Takes any type of body and a specified content type.

Corresponds with POST /files/compose (the `PostFilesCompose` operationId).

func (*Client) PostFilesWithBody

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

PostFilesWithBody Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten.

Any request header of the form `X-Metadata-<key>: <value>` is persisted as a user-defined extended attribute on the uploaded file. The `X-Metadata-` prefix is stripped and the remaining header name is lowercased to form the metadata key; the resulting map is returned on `EntryInfo` lookups (e.g. `Stat`, `ListDir`).

Each upload replaces the file's metadata with the keys provided in that request: keys previously stored but absent from the new request are removed, and an upload that sends no `X-Metadata-*` header clears all existing metadata.

Both keys and values must be printable US-ASCII (bytes `0x20`-`0x7E`) and are rejected with HTTP 400 otherwise. Each key is capped at 246 bytes (the Linux VFS xattr-name limit minus the namespace prefix), and the combined size of all metadata on a file (keys plus values, with the namespace prefix counted per key) is capped at 4096 bytes to stay within the filesystem's per-inode xattr budget. Multiple files in a single multipart upload receive the same metadata. If the same `X-Metadata-<key>` header is sent more than once, only the first value is used.

Takes any type of body and a specified content type.

Corresponds with POST /files (the `PostFiles` operationId).

type ClientInterface

type ClientInterface interface {

	// GetEnvs Environment variables
	//
	// Corresponds with GET /envs (the `GetEnvs` operationId).
	GetEnvs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetFiles Download a file
	//
	// Corresponds with GET /files (the `GetFiles` operationId).
	GetFiles(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostFilesWithBody Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten.
	//
	// Any request header of the form `X-Metadata-<key>: <value>` is persisted
	// as a user-defined extended attribute on the uploaded file. The
	// `X-Metadata-` prefix is stripped and the remaining header name is
	// lowercased to form the metadata key; the resulting map is returned on
	// `EntryInfo` lookups (e.g. `Stat`, `ListDir`).
	//
	// Each upload replaces the file's metadata with the keys provided in
	// that request: keys previously stored but absent from the new request
	// are removed, and an upload that sends no `X-Metadata-*` header clears
	// all existing metadata.
	//
	// Both keys and values must be printable US-ASCII (bytes `0x20`-`0x7E`)
	// and are rejected with HTTP 400 otherwise. Each key is capped at 246
	// bytes (the Linux VFS xattr-name limit minus the namespace prefix), and
	// the combined size of all metadata on a file (keys plus values, with the
	// namespace prefix counted per key) is capped at 4096 bytes to stay within
	// the filesystem's per-inode xattr budget. Multiple files in a single
	// multipart upload receive the same metadata. If the same
	// `X-Metadata-<key>` header is sent more than once, only the first
	// value is used.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /files (the `PostFiles` operationId).
	PostFilesWithBody(ctx context.Context, params *PostFilesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostFilesComposeWithBody Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.
	//
	// Takes any type of body and a specified content type.
	//
	// Corresponds with POST /files/compose (the `PostFilesCompose` operationId).
	PostFilesComposeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostFilesCompose Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.
	//
	// Takes a body of the `application/json` content type.
	//
	// Corresponds with POST /files/compose (the `PostFilesCompose` operationId).
	PostFilesCompose(ctx context.Context, body PostFilesComposeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetHealth Check the health of the service
	//
	// Corresponds with GET /health (the `GetHealth` operationId).
	GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMetrics Service stats
	//
	// Corresponds with GET /metrics (the `GetMetrics` operationId).
	GetMetrics(ctx context.Context, 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) GetEnvsWithResponse

func (c *ClientWithResponses) GetEnvsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEnvsResponse, error)

GetEnvsWithResponse Environment variables

Returns a wrapper object for the known response body format(s).

Corresponds with GET /envs (the `GetEnvs` operationId).

func (*ClientWithResponses) GetFilesWithResponse

func (c *ClientWithResponses) GetFilesWithResponse(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*GetFilesResponse, error)

GetFilesWithResponse Download a file

Returns a wrapper object for the known response body format(s).

Corresponds with GET /files (the `GetFiles` operationId).

func (*ClientWithResponses) GetHealthWithResponse

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

GetHealthWithResponse Check the health of the service

Returns a wrapper object for the known response body format(s).

Corresponds with GET /health (the `GetHealth` operationId).

func (*ClientWithResponses) GetMetricsWithResponse

func (c *ClientWithResponses) GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error)

GetMetricsWithResponse Service stats

Returns a wrapper object for the known response body format(s).

Corresponds with GET /metrics (the `GetMetrics` operationId).

func (*ClientWithResponses) PostFilesComposeWithBodyWithResponse added in v0.1.4

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

PostFilesComposeWithBodyWithResponse Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /files/compose (the `PostFilesCompose` operationId).

func (*ClientWithResponses) PostFilesComposeWithResponse added in v0.1.4

func (c *ClientWithResponses) PostFilesComposeWithResponse(ctx context.Context, body PostFilesComposeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFilesComposeResponse, error)

PostFilesComposeWithResponse Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.

Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /files/compose (the `PostFilesCompose` operationId).

func (*ClientWithResponses) PostFilesWithBodyWithResponse

func (c *ClientWithResponses) PostFilesWithBodyWithResponse(ctx context.Context, params *PostFilesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFilesResponse, error)

PostFilesWithBodyWithResponse Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten.

Any request header of the form `X-Metadata-<key>: <value>` is persisted as a user-defined extended attribute on the uploaded file. The `X-Metadata-` prefix is stripped and the remaining header name is lowercased to form the metadata key; the resulting map is returned on `EntryInfo` lookups (e.g. `Stat`, `ListDir`).

Each upload replaces the file's metadata with the keys provided in that request: keys previously stored but absent from the new request are removed, and an upload that sends no `X-Metadata-*` header clears all existing metadata.

Both keys and values must be printable US-ASCII (bytes `0x20`-`0x7E`) and are rejected with HTTP 400 otherwise. Each key is capped at 246 bytes (the Linux VFS xattr-name limit minus the namespace prefix), and the combined size of all metadata on a file (keys plus values, with the namespace prefix counted per key) is capped at 4096 bytes to stay within the filesystem's per-inode xattr budget. Multiple files in a single multipart upload receive the same metadata. If the same `X-Metadata-<key>` header is sent more than once, only the first value is used.

Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).

Corresponds with POST /files (the `PostFiles` operationId).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// GetEnvsWithResponse Environment variables
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /envs (the `GetEnvs` operationId).
	GetEnvsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEnvsResponse, error)

	// GetFilesWithResponse Download a file
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /files (the `GetFiles` operationId).
	GetFilesWithResponse(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*GetFilesResponse, error)

	// PostFilesWithBodyWithResponse Upload a file and ensure the parent directories exist. If the file exists, it will be overwritten.
	//
	// Any request header of the form `X-Metadata-<key>: <value>` is persisted
	// as a user-defined extended attribute on the uploaded file. The
	// `X-Metadata-` prefix is stripped and the remaining header name is
	// lowercased to form the metadata key; the resulting map is returned on
	// `EntryInfo` lookups (e.g. `Stat`, `ListDir`).
	//
	// Each upload replaces the file's metadata with the keys provided in
	// that request: keys previously stored but absent from the new request
	// are removed, and an upload that sends no `X-Metadata-*` header clears
	// all existing metadata.
	//
	// Both keys and values must be printable US-ASCII (bytes `0x20`-`0x7E`)
	// and are rejected with HTTP 400 otherwise. Each key is capped at 246
	// bytes (the Linux VFS xattr-name limit minus the namespace prefix), and
	// the combined size of all metadata on a file (keys plus values, with the
	// namespace prefix counted per key) is capped at 4096 bytes to stay within
	// the filesystem's per-inode xattr budget. Multiple files in a single
	// multipart upload receive the same metadata. If the same
	// `X-Metadata-<key>` header is sent more than once, only the first
	// value is used.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /files (the `PostFiles` operationId).
	PostFilesWithBodyWithResponse(ctx context.Context, params *PostFilesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFilesResponse, error)

	// PostFilesComposeWithBodyWithResponse Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.
	//
	// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /files/compose (the `PostFilesCompose` operationId).
	PostFilesComposeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFilesComposeResponse, error)

	// PostFilesComposeWithResponse Compose multiple files into a single file using zero-copy concatenation. Source files are deleted after successful composition.
	//
	// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
	//
	// Corresponds with POST /files/compose (the `PostFilesCompose` operationId).
	PostFilesComposeWithResponse(ctx context.Context, body PostFilesComposeJSONRequestBody, reqEditors ...RequestEditorFn) (*PostFilesComposeResponse, error)

	// GetHealthWithResponse Check the health of the service
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /health (the `GetHealth` operationId).
	GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

	// GetMetricsWithResponse Service stats
	//
	// Returns a wrapper object for the known response body format(s).
	//
	// Corresponds with GET /metrics (the `GetMetrics` operationId).
	GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error)
}

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

type ComposeRequest added in v0.1.4

type ComposeRequest struct {
	// Destination Destination file path for the composed file
	Destination string `json:"destination"`

	// SourcePaths Ordered list of source file paths to concatenate
	SourcePaths []string `json:"source_paths"`

	// Username User for setting ownership and resolving relative paths
	Username *string `json:"username,omitempty"`
}

ComposeRequest defines model for ComposeRequest.

type EntryInfo

type EntryInfo struct {
	// Metadata User-defined metadata stored as extended attributes on the file.
	Metadata *map[string]string `json:"metadata,omitempty"`

	// Name Name of the file
	Name string `json:"name"`

	// Path Path to the file
	Path string `json:"path"`

	// Type Type of the file
	Type EntryInfoType `json:"type"`
}

EntryInfo defines model for EntryInfo.

type EntryInfoType

type EntryInfoType string

EntryInfoType Type of the file

const (
	File EntryInfoType = "file"
)

Defines values for EntryInfoType.

func (EntryInfoType) Valid

func (e EntryInfoType) Valid() bool

Valid indicates whether the value is a known member of the EntryInfoType enum.

type EnvVars

type EnvVars map[string]string

EnvVars Environment variables to set

type Error

type Error struct {
	// Code Error code
	Code int `json:"code"`

	// Message Error message
	Message string `json:"message"`
}

Error defines model for Error.

type FileNotFound

type FileNotFound = Error

FileNotFound defines model for FileNotFound.

type FilePath

type FilePath = string

FilePath defines model for FilePath.

type GetEnvsResponse

type GetEnvsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *EnvVars
}

func ParseGetEnvsResponse

func ParseGetEnvsResponse(rsp *http.Response) (*GetEnvsResponse, error)

ParseGetEnvsResponse parses an HTTP response from a GetEnvsWithResponse call

func (GetEnvsResponse) ContentType added in v0.1.4

func (r GetEnvsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetEnvsResponse) GetBody added in v0.1.4

func (r GetEnvsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetEnvsResponse) GetJSON200 added in v0.1.4

func (r GetEnvsResponse) GetJSON200() *EnvVars

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetEnvsResponse) Status

func (r GetEnvsResponse) Status() string

Status returns HTTPResponse.Status

func (GetEnvsResponse) StatusCode

func (r GetEnvsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetFilesParams

type GetFilesParams struct {
	// Path Path to the file, URL encoded. Can be relative to the user's home directory (e.g. "file.txt" resolves to ~/file.txt).
	Path *FilePath `form:"path,omitempty" json:"path,omitempty"`

	// Username User for setting file ownership and resolving relative paths. Defaults to the sandbox's default user.
	Username *User `form:"username,omitempty" json:"username,omitempty"`

	// Signature Signature used for file access permission verification.
	Signature *Signature `form:"signature,omitempty" json:"signature,omitempty"`

	// SignatureExpiration Unix timestamp (seconds) after which the signature expires. Only used with the signature parameter.
	SignatureExpiration *SignatureExpiration `form:"signature_expiration,omitempty" json:"signature_expiration,omitempty"`
}

GetFilesParams defines parameters for GetFiles.

type GetFilesResponse

type GetFilesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *InvalidPath
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *InvalidUser
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *FileNotFound
	// JSON406 the response for an HTTP 406 `application/json` response
	JSON406 *NotAcceptable
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *InternalServerError
}

func ParseGetFilesResponse

func ParseGetFilesResponse(rsp *http.Response) (*GetFilesResponse, error)

ParseGetFilesResponse parses an HTTP response from a GetFilesWithResponse call

func (GetFilesResponse) ContentType added in v0.1.4

func (r GetFilesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetFilesResponse) GetBody added in v0.1.4

func (r GetFilesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetFilesResponse) GetJSON400 added in v0.1.4

func (r GetFilesResponse) GetJSON400() *InvalidPath

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (GetFilesResponse) GetJSON401 added in v0.1.4

func (r GetFilesResponse) GetJSON401() *InvalidUser

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (GetFilesResponse) GetJSON404 added in v0.1.4

func (r GetFilesResponse) GetJSON404() *FileNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetFilesResponse) GetJSON406 added in v0.1.4

func (r GetFilesResponse) GetJSON406() *NotAcceptable

GetJSON406 returns the response for an HTTP 406 `application/json` response

func (GetFilesResponse) GetJSON500 added in v0.1.4

func (r GetFilesResponse) GetJSON500() *InternalServerError

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetFilesResponse) Status

func (r GetFilesResponse) Status() string

Status returns HTTPResponse.Status

func (GetFilesResponse) StatusCode

func (r GetFilesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetHealthResponse

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

func ParseGetHealthResponse

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

ParseGetHealthResponse parses an HTTP response from a GetHealthWithResponse call

func (GetHealthResponse) ContentType added in v0.1.4

func (r GetHealthResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetHealthResponse) GetBody added in v0.1.4

func (r GetHealthResponse) GetBody() []byte

GetBody returns the raw response body bytes

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 GetMetricsResponse

type GetMetricsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *Metrics
}

func ParseGetMetricsResponse

func ParseGetMetricsResponse(rsp *http.Response) (*GetMetricsResponse, error)

ParseGetMetricsResponse parses an HTTP response from a GetMetricsWithResponse call

func (GetMetricsResponse) ContentType added in v0.1.4

func (r GetMetricsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetMetricsResponse) GetBody added in v0.1.4

func (r GetMetricsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetMetricsResponse) GetJSON200 added in v0.1.4

func (r GetMetricsResponse) GetJSON200() *Metrics

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetMetricsResponse) Status

func (r GetMetricsResponse) Status() string

Status returns HTTPResponse.Status

func (GetMetricsResponse) StatusCode

func (r GetMetricsResponse) 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 InternalServerError

type InternalServerError = Error

InternalServerError defines model for InternalServerError.

type InvalidPath

type InvalidPath = Error

InvalidPath defines model for InvalidPath.

type InvalidUser

type InvalidUser = Error

InvalidUser defines model for InvalidUser.

type Metrics

type Metrics struct {
	// CpuCount Number of CPU cores online
	CpuCount *int `json:"cpu_count,omitempty"`

	// CpuPossible Number of CPUs the guest can bring online
	CpuPossible *int `json:"cpu_possible,omitempty"`

	// CpuTarget Online count last requested, 0 when none was
	CpuTarget *int `json:"cpu_target,omitempty"`

	// CpuTargetAttempts Attempts at reaching cpu_target since it was set
	CpuTargetAttempts *int `json:"cpu_target_attempts,omitempty"`

	// CpuUsedPct CPU usage percentage
	CpuUsedPct *float32 `json:"cpu_used_pct,omitempty"`

	// CpuWritePendingMs How long a CPU online or offline write has been running in the guest kernel, 0 when none is. A value that keeps growing means CPU hotplug is stuck.
	CpuWritePendingMs *int64 `json:"cpu_write_pending_ms,omitempty"`

	// DiskTotal Total disk space in bytes
	DiskTotal *int `json:"disk_total,omitempty"`

	// DiskUsed Used disk space in bytes
	DiskUsed *int `json:"disk_used,omitempty"`

	// MemCache Cached memory (page cache) in bytes
	MemCache *int `json:"mem_cache,omitempty"`

	// MemTotal Total virtual memory in bytes
	MemTotal *int `json:"mem_total,omitempty"`

	// MemUsed Used virtual memory in bytes
	MemUsed *int `json:"mem_used,omitempty"`

	// OomKills The latest 32 out-of-memory kills since the guest booted, oldest first. Reading does not consume them. Empty when there are none. Omitted when not known (while envd is still reading the kernel log, when it can't be read or envd stopped reading it, and outside Firecracker).
	OomKills *[]OOMKill `json:"oom_kills,omitempty"`

	// Ts Unix timestamp in UTC for current sandbox time
	Ts *int64 `json:"ts,omitempty"`
}

Metrics Resource usage metrics

type NotAcceptable added in v0.1.4

type NotAcceptable = Error

NotAcceptable defines model for NotAcceptable.

type NotEnoughDiskSpace

type NotEnoughDiskSpace = Error

NotEnoughDiskSpace defines model for NotEnoughDiskSpace.

type OOMKill added in v0.1.4

type OOMKill struct {
	// Process Name of the killed process, or Unknown if the record doesn't show it
	Process string `json:"process"`

	// Seq Kernel log sequence number of the kill record. It only grows, across pauses and envd restarts.
	Seq int64 `json:"seq"`
}

OOMKill A process the guest kernel killed for running out of memory

type PostFilesComposeJSONRequestBody added in v0.1.4

type PostFilesComposeJSONRequestBody = ComposeRequest

PostFilesComposeJSONRequestBody defines body for PostFilesCompose for application/json ContentType.

type PostFilesComposeResponse added in v0.1.4

type PostFilesComposeResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *EntryInfo
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *InvalidPath
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *InvalidUser
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *FileNotFound
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *InternalServerError
	// JSON507 the response for an HTTP 507 `application/json` response
	JSON507 *NotEnoughDiskSpace
}

func ParsePostFilesComposeResponse added in v0.1.4

func ParsePostFilesComposeResponse(rsp *http.Response) (*PostFilesComposeResponse, error)

ParsePostFilesComposeResponse parses an HTTP response from a PostFilesComposeWithResponse call

func (PostFilesComposeResponse) ContentType added in v0.1.4

func (r PostFilesComposeResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PostFilesComposeResponse) GetBody added in v0.1.4

func (r PostFilesComposeResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PostFilesComposeResponse) GetJSON200 added in v0.1.4

func (r PostFilesComposeResponse) GetJSON200() *EntryInfo

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PostFilesComposeResponse) GetJSON400 added in v0.1.4

func (r PostFilesComposeResponse) GetJSON400() *InvalidPath

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (PostFilesComposeResponse) GetJSON401 added in v0.1.4

func (r PostFilesComposeResponse) GetJSON401() *InvalidUser

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (PostFilesComposeResponse) GetJSON404 added in v0.1.4

func (r PostFilesComposeResponse) GetJSON404() *FileNotFound

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (PostFilesComposeResponse) GetJSON500 added in v0.1.4

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (PostFilesComposeResponse) GetJSON507 added in v0.1.4

GetJSON507 returns the response for an HTTP 507 `application/json` response

func (PostFilesComposeResponse) Status added in v0.1.4

func (r PostFilesComposeResponse) Status() string

Status returns HTTPResponse.Status

func (PostFilesComposeResponse) StatusCode added in v0.1.4

func (r PostFilesComposeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PostFilesMultipartBody

type PostFilesMultipartBody struct {
	File *openapi_types.File `json:"file,omitempty"`
}

PostFilesMultipartBody defines parameters for PostFiles.

type PostFilesMultipartRequestBody

type PostFilesMultipartRequestBody PostFilesMultipartBody

PostFilesMultipartRequestBody defines body for PostFiles for multipart/form-data ContentType.

type PostFilesParams

type PostFilesParams struct {
	// Path Path to the file, URL encoded. Can be relative to the user's home directory (e.g. "file.txt" resolves to ~/file.txt).
	Path *FilePath `form:"path,omitempty" json:"path,omitempty"`

	// Username User for setting file ownership and resolving relative paths. Defaults to the sandbox's default user.
	Username *User `form:"username,omitempty" json:"username,omitempty"`

	// Signature Signature used for file access permission verification.
	Signature *Signature `form:"signature,omitempty" json:"signature,omitempty"`

	// SignatureExpiration Unix timestamp (seconds) after which the signature expires. Only used with the signature parameter.
	SignatureExpiration *SignatureExpiration `form:"signature_expiration,omitempty" json:"signature_expiration,omitempty"`
}

PostFilesParams defines parameters for PostFiles.

type PostFilesResponse

type PostFilesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *UploadSuccess
	// JSON400 the response for an HTTP 400 `application/json` response
	JSON400 *InvalidPath
	// JSON401 the response for an HTTP 401 `application/json` response
	JSON401 *InvalidUser
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *InternalServerError
	// JSON507 the response for an HTTP 507 `application/json` response
	JSON507 *NotEnoughDiskSpace
}

func ParsePostFilesResponse

func ParsePostFilesResponse(rsp *http.Response) (*PostFilesResponse, error)

ParsePostFilesResponse parses an HTTP response from a PostFilesWithResponse call

func (PostFilesResponse) ContentType added in v0.1.4

func (r PostFilesResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (PostFilesResponse) GetBody added in v0.1.4

func (r PostFilesResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (PostFilesResponse) GetJSON200 added in v0.1.4

func (r PostFilesResponse) GetJSON200() *UploadSuccess

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (PostFilesResponse) GetJSON400 added in v0.1.4

func (r PostFilesResponse) GetJSON400() *InvalidPath

GetJSON400 returns the response for an HTTP 400 `application/json` response

func (PostFilesResponse) GetJSON401 added in v0.1.4

func (r PostFilesResponse) GetJSON401() *InvalidUser

GetJSON401 returns the response for an HTTP 401 `application/json` response

func (PostFilesResponse) GetJSON500 added in v0.1.4

func (r PostFilesResponse) GetJSON500() *InternalServerError

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (PostFilesResponse) GetJSON507 added in v0.1.4

func (r PostFilesResponse) GetJSON507() *NotEnoughDiskSpace

GetJSON507 returns the response for an HTTP 507 `application/json` response

func (PostFilesResponse) Status

func (r PostFilesResponse) Status() string

Status returns HTTPResponse.Status

func (PostFilesResponse) StatusCode

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

type Signature

type Signature = string

Signature defines model for Signature.

type SignatureExpiration

type SignatureExpiration = int

SignatureExpiration defines model for SignatureExpiration.

type UploadSuccess

type UploadSuccess = []EntryInfo

UploadSuccess defines model for UploadSuccess.

type User

type User = string

User defines model for User.

Jump to

Keyboard shortcuts

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