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
- func NewGetEnvsRequest(server string) (*http.Request, error)
- func NewGetFilesRequest(server string, params *GetFilesParams) (*http.Request, error)
- func NewGetHealthRequest(server string) (*http.Request, error)
- func NewGetMetricsRequest(server string) (*http.Request, error)
- func NewPostFilesRequestWithBody(server string, params *PostFilesParams, contentType string, body io.Reader) (*http.Request, error)
- func NewPostInitRequest(server string, body PostInitJSONRequestBody) (*http.Request, error)
- func NewPostInitRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- type Client
- func (c *Client) GetEnvs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetFiles(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetHealth(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetMetrics(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PostFilesWithBody(ctx context.Context, params *PostFilesParams, contentType string, ...) (*http.Response, error)
- func (c *Client) PostInit(ctx context.Context, body PostInitJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PostInitWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) GetEnvsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEnvsResponse, error)
- func (c *ClientWithResponses) GetFilesWithResponse(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*GetFilesResponse, error)
- func (c *ClientWithResponses) GetHealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetHealthResponse, error)
- func (c *ClientWithResponses) GetMetricsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMetricsResponse, error)
- func (c *ClientWithResponses) PostFilesWithBodyWithResponse(ctx context.Context, params *PostFilesParams, contentType string, ...) (*PostFilesResponse, error)
- func (c *ClientWithResponses) PostInitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PostInitResponse, error)
- func (c *ClientWithResponses) PostInitWithResponse(ctx context.Context, body PostInitJSONRequestBody, ...) (*PostInitResponse, error)
- type ClientWithResponsesInterface
- type EntryInfo
- type EntryInfoType
- type EnvVars
- type Error
- type FileNotFound
- type FilePath
- type GetEnvsResponse
- type GetFilesParams
- type GetFilesResponse
- type GetHealthResponse
- type GetMetricsResponse
- type HttpRequestDoer
- type InternalServerError
- type InvalidPath
- type InvalidUser
- type Metrics
- type NotEnoughDiskSpace
- type PostFilesMultipartBody
- type PostFilesMultipartRequestBody
- type PostFilesParams
- type PostFilesResponse
- type PostInitJSONBody
- type PostInitJSONRequestBody
- type PostInitResponse
- type RequestEditorFn
- type SecureToken
- type Signature
- type SignatureExpiration
- type UploadSuccess
- type User
- type VolumeMount
Constants ¶
const (
AccessTokenAuthScopes = "AccessTokenAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewGetEnvsRequest ¶
NewGetEnvsRequest generates requests for GetEnvs
func NewGetFilesRequest ¶
func NewGetFilesRequest(server string, params *GetFilesParams) (*http.Request, error)
NewGetFilesRequest generates requests for GetFiles
func NewGetHealthRequest ¶
NewGetHealthRequest generates requests for GetHealth
func NewGetMetricsRequest ¶
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
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) GetFiles ¶
func (c *Client) GetFiles(ctx context.Context, params *GetFilesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) GetMetrics ¶
func (*Client) PostFilesWithBody ¶
func (*Client) PostInit ¶
func (c *Client) PostInit(ctx context.Context, body PostInitJSONRequestBody, 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 ¶
ClientOption allows setting custom parameters during construction
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 Error ¶
type Error struct {
// Code Error code
Code int `json:"code"`
// Message Error message
Message string `json:"message"`
}
Error defines model for Error.
type GetEnvsResponse ¶
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 ¶
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 ¶
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 ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InternalServerError ¶
type InternalServerError = Error
InternalServerError defines model for InternalServerError.
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 ¶
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 ¶
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 SignatureExpiration ¶
type SignatureExpiration = int
SignatureExpiration defines model for SignatureExpiration.
type UploadSuccess ¶
type UploadSuccess = []EntryInfo
UploadSuccess defines model for UploadSuccess.
type VolumeMount ¶
VolumeMount Volume