envd

package
v0.0.0-...-35dcf12 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	AccessTokenAuthScopes = "AccessTokenAuth.Scopes"
)

Variables

This section is empty.

Functions

func NewGetEnvsRequest

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

NewGetEnvsRequest generates requests for GetEnvs

func NewGetFilesRequest

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

NewGetFilesRequest generates requests for GetFiles

func NewGetHealthRequest

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

NewGetHealthRequest generates requests for GetHealth

func NewGetMetricsRequest

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

NewGetMetricsRequest generates requests for GetMetrics

func NewPostFilesRequestWithBody

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

NewPostFilesRequestWithBody generates requests for PostFiles with any type of body

func NewPostInitRequest

func NewPostInitRequest(server string, body PostInitJSONRequestBody) (*http.Request, error)

NewPostInitRequest calls the generic PostInit builder with application/json body

func NewPostInitRequestWithBody

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

NewPostInitRequestWithBody generates requests for PostInit 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) GetEnvs

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

func (*Client) GetFiles

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

func (*Client) GetHealth

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

func (*Client) GetMetrics

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

func (*Client) PostFilesWithBody

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

func (*Client) PostInit

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

func (*Client) PostInitWithBody

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

type ClientInterface

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

	// GetFiles request
	GetFiles(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

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

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

	PostInit(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMetrics request
	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 request returning *GetEnvsResponse

func (*ClientWithResponses) GetFilesWithResponse

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

GetFilesWithResponse request returning *GetFilesResponse

func (*ClientWithResponses) GetHealthWithResponse

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

GetHealthWithResponse request returning *GetHealthResponse

func (*ClientWithResponses) GetMetricsWithResponse

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

GetMetricsWithResponse request returning *GetMetricsResponse

func (*ClientWithResponses) PostFilesWithBodyWithResponse

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

PostFilesWithBodyWithResponse request with arbitrary body returning *PostFilesResponse

func (*ClientWithResponses) PostInitWithBodyWithResponse

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

PostInitWithBodyWithResponse request with arbitrary body returning *PostInitResponse

func (*ClientWithResponses) PostInitWithResponse

func (c *ClientWithResponses) PostInitWithResponse(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInitResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetEnvsWithResponse request
	GetEnvsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEnvsResponse, error)

	// GetFilesWithResponse request
	GetFilesWithResponse(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*GetFilesResponse, error)

	// PostFilesWithBodyWithResponse request with any body
	PostFilesWithBodyWithResponse(ctx context.Context, params *PostFilesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostFilesResponse, error)

	// GetHealthWithResponse request
	GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)

	// PostInitWithBodyWithResponse request with any body
	PostInitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostInitResponse, error)

	PostInitWithResponse(ctx context.Context, body PostInitJSONRequestBody, reqEditors ...RequestEditorFn) (*PostInitResponse, error)

	// GetMetricsWithResponse request
	GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error)
}

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

type EntryInfo

type EntryInfo struct {
	// 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.

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      *EnvVars
}

func ParseGetEnvsResponse

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

ParseGetEnvsResponse parses an HTTP response from a GetEnvsWithResponse call

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 user's home directory.
	Path *FilePath `form:"path,omitempty" json:"path,omitempty"`

	// Username User used for setting the owner, or resolving relative paths.
	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 Signature expiration used for defining the expiration time of the signature.
	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      *InvalidPath
	JSON401      *InvalidUser
	JSON404      *FileNotFound
	JSON500      *InternalServerError
}

func ParseGetFilesResponse

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

ParseGetFilesResponse parses an HTTP response from a GetFilesWithResponse call

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) 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      *Metrics
}

func ParseGetMetricsResponse

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

ParseGetMetricsResponse parses an HTTP response from a GetMetricsWithResponse call

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
	CpuCount *int `json:"cpu_count,omitempty"`

	// CpuUsedPct CPU usage percentage
	CpuUsedPct *float32 `json:"cpu_used_pct,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"`

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

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

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

Metrics Resource usage metrics

type NotEnoughDiskSpace

type NotEnoughDiskSpace = Error

NotEnoughDiskSpace defines model for NotEnoughDiskSpace.

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 user's home directory.
	Path *FilePath `form:"path,omitempty" json:"path,omitempty"`

	// Username User used for setting the owner, or resolving relative paths.
	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 Signature expiration used for defining the expiration time of the signature.
	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      *UploadSuccess
	JSON400      *InvalidPath
	JSON401      *InvalidUser
	JSON500      *InternalServerError
	JSON507      *NotEnoughDiskSpace
}

func ParsePostFilesResponse

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

ParsePostFilesResponse parses an HTTP response from a PostFilesWithResponse call

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 PostInitJSONBody

type PostInitJSONBody struct {
	// AccessToken Access token for secure access to envd service
	AccessToken *SecureToken `json:"accessToken,omitempty"`

	// DefaultUser The default user to use for operations
	DefaultUser *string `json:"defaultUser,omitempty"`

	// DefaultWorkdir The default working directory to use for operations
	DefaultWorkdir *string `json:"defaultWorkdir,omitempty"`

	// EnvVars Environment variables to set
	EnvVars *EnvVars `json:"envVars,omitempty"`

	// HyperloopIP IP address of the hyperloop server to connect to
	HyperloopIP *string `json:"hyperloopIP,omitempty"`

	// Timestamp The current timestamp in RFC3339 format
	Timestamp    *time.Time     `json:"timestamp,omitempty"`
	VolumeMounts *[]VolumeMount `json:"volumeMounts,omitempty"`
}

PostInitJSONBody defines parameters for PostInit.

type PostInitJSONRequestBody

type PostInitJSONRequestBody PostInitJSONBody

PostInitJSONRequestBody defines body for PostInit for application/json ContentType.

type PostInitResponse

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

func ParsePostInitResponse

func ParsePostInitResponse(rsp *http.Response) (*PostInitResponse, error)

ParsePostInitResponse parses an HTTP response from a PostInitWithResponse call

func (PostInitResponse) Status

func (r PostInitResponse) Status() string

Status returns HTTPResponse.Status

func (PostInitResponse) StatusCode

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

type SecureToken = string

SecureToken is a type alias for access tokens in the integration test client. The actual SecureToken with secure memory handling is only used in the envd service itself.

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.

type VolumeMount

type VolumeMount struct {
	NfsTarget string `json:"nfs_target"`
	Path      string `json:"path"`
}

VolumeMount Volume

Jump to

Keyboard shortcuts

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