Documentation
¶
Index ¶
- Constants
- Variables
- func NewCreateEndpoint(s Service) goa.Endpoint
- func NewDeleteEndpoint(s Service) goa.Endpoint
- func NewGetEndpoint(s Service) goa.Endpoint
- func NewListEndpoint(s Service) goa.Endpoint
- func NewResetEndpoint(s Service) goa.Endpoint
- func NewStartEndpoint(s Service) goa.Endpoint
- func NewStopEndpoint(s Service) goa.Endpoint
- func NewViewedWorkspace(res *Workspace, view string) *workspacesviews.Workspace
- type AlreadyExists
- type Client
- func (c *Client) Create(ctx context.Context, p *CreateWorkspacePayload) (res *Workspace, err error)
- func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
- func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Workspace, err error)
- func (c *Client) List(ctx context.Context, p *ListPayload) (res []*Workspace, err error)
- func (c *Client) Reset(ctx context.Context, p *ResetPayload) (res *Workspace, err error)
- func (c *Client) Start(ctx context.Context, p *StartPayload) (res *Workspace, err error)
- func (c *Client) Stop(ctx context.Context, p *StopPayload) (res *Workspace, err error)
- type ContainerState
- type CreateWorkspacePayload
- type DeletePayload
- type Endpoints
- type EnvVar
- type GetPayload
- type Invalid
- type ListPayload
- type NotFound
- type ResetPayload
- type Service
- type StartPayload
- type StopPayload
- type Toleration
- type VolumeMount
- type Workspace
- type WorkspaceCondition
- type WorkspaceContainer
Constants ¶
const APIName = "kube-workspaces"
APIName is the name of the API as defined in the design.
const APIVersion = "1.0.0"
APIVersion is the version of the API as defined in the design.
const ServiceName = "workspaces"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [7]string{"list", "get", "create", "delete", "start", "stop", "reset"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func NewCreateEndpoint ¶
NewCreateEndpoint returns an endpoint function that calls the method "create" of service "workspaces".
func NewDeleteEndpoint ¶
NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "workspaces".
func NewGetEndpoint ¶
NewGetEndpoint returns an endpoint function that calls the method "get" of service "workspaces".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "list" of service "workspaces".
func NewResetEndpoint ¶ added in v0.4.0
NewResetEndpoint returns an endpoint function that calls the method "reset" of service "workspaces".
func NewStartEndpoint ¶
NewStartEndpoint returns an endpoint function that calls the method "start" of service "workspaces".
func NewStopEndpoint ¶
NewStopEndpoint returns an endpoint function that calls the method "stop" of service "workspaces".
func NewViewedWorkspace ¶
func NewViewedWorkspace(res *Workspace, view string) *workspacesviews.Workspace
NewViewedWorkspace initializes viewed result type Workspace from result type Workspace using the given view.
Types ¶
type AlreadyExists ¶
type AlreadyExists string
Workspace already exists
func (AlreadyExists) Error ¶
func (e AlreadyExists) Error() string
Error returns an error description.
func (AlreadyExists) ErrorName
deprecated
func (e AlreadyExists) ErrorName() string
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (AlreadyExists) GoaErrorName ¶
func (e AlreadyExists) GoaErrorName() string
GoaErrorName returns the error name.
type Client ¶
type Client struct {
ListEndpoint goa.Endpoint
GetEndpoint goa.Endpoint
CreateEndpoint goa.Endpoint
DeleteEndpoint goa.Endpoint
StartEndpoint goa.Endpoint
StopEndpoint goa.Endpoint
ResetEndpoint goa.Endpoint
}
Client is the "workspaces" service client.
func (*Client) Create ¶
Create calls the "create" endpoint of the "workspaces" service. Create may return the following errors:
- "already_exists" (type AlreadyExists)
- "invalid" (type Invalid)
- error: internal error
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
Delete calls the "delete" endpoint of the "workspaces" service. Delete may return the following errors:
- "not_found" (type NotFound)
- error: internal error
func (*Client) Get ¶
Get calls the "get" endpoint of the "workspaces" service. Get may return the following errors:
- "not_found" (type NotFound)
- error: internal error
func (*Client) Reset ¶ added in v0.4.0
Reset calls the "reset" endpoint of the "workspaces" service. Reset may return the following errors:
- "not_found" (type NotFound)
- "invalid" (type Invalid)
- error: internal error
type ContainerState ¶
type ContainerState struct {
// Current state: running, waiting, terminated
State *string
// Reason for the state
Reason *string
// Details about the state
Message *string
// Time the container started
StartedAt *string
}
State of the workspace container
type CreateWorkspacePayload ¶
type CreateWorkspacePayload struct {
// Workspace name
Name string
// Target namespace
Namespace string
// Workspace type: 'container' (default, runs as a StatefulSet), 'vm' (KubeVirt
// VirtualMachine booting a containerDisk image), or 'scratch' (plain
// Deployment)
Type string
// Main container spec
Container *WorkspaceContainer
// Volumes to mount
VolumeMounts []*VolumeMount
// Custom environment variables to inject into the workspace container
Env []*EnvVar
// Pod tolerations for scheduling
Tolerations []*Toleration
// Node selector labels for scheduling
NodeSelector map[string]string
// frameworks)
SharedMemory bool
// Image pull policy for the workspace container (Always, IfNotPresent, Never)
ImagePullPolicy string
}
CreateWorkspacePayload is the payload type of the workspaces service create method.
type DeletePayload ¶
DeletePayload is the payload type of the workspaces service delete method.
type Endpoints ¶
type Endpoints struct {
List goa.Endpoint
Get goa.Endpoint
Create goa.Endpoint
Delete goa.Endpoint
Start goa.Endpoint
Stop goa.Endpoint
Reset goa.Endpoint
}
Endpoints wraps the "workspaces" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "workspaces" service with endpoints.
type EnvVar ¶
type EnvVar struct {
// Environment variable name
Name string
// Environment variable value
Value string
}
Custom environment variable for a workspace
type GetPayload ¶
GetPayload is the payload type of the workspaces service get method.
type Invalid ¶
type Invalid string
Invalid workspace specification
func (Invalid) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (Invalid) GoaErrorName ¶
GoaErrorName returns the error name.
type ListPayload ¶
type ListPayload struct {
// Filter by namespace
Namespace string
}
ListPayload is the payload type of the workspaces service list method.
type NotFound ¶
type NotFound string
Workspace not found
func (NotFound) ErrorName
deprecated
ErrorName returns the error name.
Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
func (NotFound) GoaErrorName ¶
GoaErrorName returns the error name.
type ResetPayload ¶ added in v0.4.0
ResetPayload is the payload type of the workspaces service reset method.
type Service ¶
type Service interface {
// List all workspaces
List(context.Context, *ListPayload) (res []*Workspace, err error)
// Get a workspace by name
Get(context.Context, *GetPayload) (res *Workspace, err error)
// Create a new workspace
Create(context.Context, *CreateWorkspacePayload) (res *Workspace, err error)
// Delete a workspace
Delete(context.Context, *DeletePayload) (err error)
// Start a stopped workspace
Start(context.Context, *StartPayload) (res *Workspace, err error)
// Stop a running workspace
Stop(context.Context, *StopPayload) (res *Workspace, err error)
// Reset a workspace by re-provisioning it from its image
Reset(context.Context, *ResetPayload) (res *Workspace, err error)
}
Workspace management service
type StartPayload ¶
StartPayload is the payload type of the workspaces service start method.
type StopPayload ¶
StopPayload is the payload type of the workspaces service stop method.
type Toleration ¶
type Toleration struct {
// Toleration key
Key string
// Operator: Exists or Equal
Operator string
// Toleration value
Value *string
// Taint effect: NoSchedule, PreferNoSchedule, or NoExecute
Effect *string
}
Kubernetes pod toleration
type VolumeMount ¶
type VolumeMount struct {
// Volume/PVC name
Name string
// Mount path in container
MountPath string
}
Volume mount for a workspace container
type Workspace ¶
type Workspace struct {
// Workspace name
Name string
// Kubernetes namespace
Namespace string
// Workspace type: container, vm, or scratch
Type string
// Container image
Image string
// Container port
Port *int
// CPU request
CPURequest *string
// Memory request
MemoryRequest *string
// CPU limit
CPULimit *string
// Memory limit
MemoryLimit *string
// Number of ready replicas
ReadyReplicas int
// Container state
ContainerState *ContainerState
// Workspace conditions
Conditions []*WorkspaceCondition
// Whether the workspace is stopped
Stopped bool
// Creation timestamp
CreatedAt *string
// Attached volumes
VolumeMounts []*VolumeMount
}
Workspace is the result type of the workspaces service get method.
func NewWorkspace ¶
func NewWorkspace(vres *workspacesviews.Workspace) *Workspace
NewWorkspace initializes result type Workspace from viewed result type Workspace.
type WorkspaceCondition ¶
type WorkspaceCondition struct {
// Condition type
Type *string
// Condition status
Status *string
// Brief reason
Reason *string
// Detailed message
Message *string
// Last transition time
LastTransitionTime *string
}
Condition of a workspace
type WorkspaceContainer ¶
type WorkspaceContainer struct {
// Container name
Name string
// Container image
Image string
// Container port
Port int
// CPU request
CPURequest string
// Memory request
MemoryRequest string
// CPU limit
CPULimit string
// Memory limit
MemoryLimit string
// GPU resource request count (e.g. "1")
GpuRequest *string
// GPU vendor resource name (e.g. nvidia.com/gpu, amd.com/gpu)
GpuVendor string
}
Container specification for a workspace