Help us shape the future of Go! Take the 2026 Go Developer Survey

workspaces

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "kube-workspaces"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "1.0.0"

APIVersion is the version of the API as defined in the design.

View Source
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

View Source
var MethodNames = [9]string{"credentials", "list", "get", "create", "delete", "start", "stop", "reset", "clone"}

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 NewCloneEndpoint added in v0.5.0

func NewCloneEndpoint(s Service) goa.Endpoint

NewCloneEndpoint returns an endpoint function that calls the method "clone" of service "workspaces".

func NewCreateEndpoint

func NewCreateEndpoint(s Service) goa.Endpoint

NewCreateEndpoint returns an endpoint function that calls the method "create" of service "workspaces".

func NewCredentialsEndpoint added in v0.7.0

func NewCredentialsEndpoint(s Service) goa.Endpoint

NewCredentialsEndpoint returns an endpoint function that calls the method "credentials" of service "workspaces".

func NewDeleteEndpoint

func NewDeleteEndpoint(s Service) goa.Endpoint

NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "workspaces".

func NewGetEndpoint

func NewGetEndpoint(s Service) goa.Endpoint

NewGetEndpoint returns an endpoint function that calls the method "get" of service "workspaces".

func NewListEndpoint

func NewListEndpoint(s Service) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "workspaces".

func NewResetEndpoint added in v0.4.0

func NewResetEndpoint(s Service) goa.Endpoint

NewResetEndpoint returns an endpoint function that calls the method "reset" of service "workspaces".

func NewStartEndpoint

func NewStartEndpoint(s Service) goa.Endpoint

NewStartEndpoint returns an endpoint function that calls the method "start" of service "workspaces".

func NewStopEndpoint

func NewStopEndpoint(s Service) goa.Endpoint

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 {
	CredentialsEndpoint goa.Endpoint
	ListEndpoint        goa.Endpoint
	GetEndpoint         goa.Endpoint
	CreateEndpoint      goa.Endpoint
	DeleteEndpoint      goa.Endpoint
	StartEndpoint       goa.Endpoint
	StopEndpoint        goa.Endpoint
	ResetEndpoint       goa.Endpoint
	CloneEndpoint       goa.Endpoint
}

Client is the "workspaces" service client.

func NewClient

func NewClient(credentials, list, get, create, delete_, start, stop, reset, clone goa.Endpoint) *Client

NewClient initializes a "workspaces" service client given the endpoints.

func (*Client) Clone added in v0.5.0

func (c *Client) Clone(ctx context.Context, p *ClonePayload) (res *Workspace, err error)

Clone calls the "clone" endpoint of the "workspaces" service. Clone may return the following errors:

  • "not_found" (type NotFound)
  • "already_exists" (type AlreadyExists)
  • "invalid" (type Invalid)
  • error: internal error

func (*Client) Create

func (c *Client) Create(ctx context.Context, p *CreateWorkspacePayload) (res *Workspace, err error)

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) Credentials added in v0.7.0

func (c *Client) Credentials(ctx context.Context, p *CredentialsPayload) (res *WorkspaceInitialCredentials, err error)

Credentials calls the "credentials" endpoint of the "workspaces" service. Credentials may return the following errors:

  • "forbidden" (type Forbidden)
  • "not_found" (type NotFound)
  • "unavailable" (type Unavailable)
  • 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

func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Workspace, err error)

Get calls the "get" endpoint of the "workspaces" service. Get may return the following errors:

  • "not_found" (type NotFound)
  • error: internal error

func (*Client) List

func (c *Client) List(ctx context.Context, p *ListPayload) (res []*Workspace, err error)

List calls the "list" endpoint of the "workspaces" service.

func (*Client) Reset added in v0.4.0

func (c *Client) Reset(ctx context.Context, p *ResetPayload) (res *Workspace, err error)

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

func (*Client) Start

func (c *Client) Start(ctx context.Context, p *StartPayload) (res *Workspace, err error)

Start calls the "start" endpoint of the "workspaces" service. Start may return the following errors:

  • "not_found" (type NotFound)
  • error: internal error

func (*Client) Stop

func (c *Client) Stop(ctx context.Context, p *StopPayload) (res *Workspace, err error)

Stop calls the "stop" endpoint of the "workspaces" service. Stop may return the following errors:

  • "not_found" (type NotFound)
  • error: internal error

type ClonePayload added in v0.5.0

type ClonePayload struct {
	// Namespace
	Namespace string
	// Source workspace name
	Name string
	// Name for the cloned workspace
	NewName string
	// Override the container image on the clone
	Image *string
	// Override the container port on the clone
	Port *int
	// Override the CPU request on the clone
	CPURequest *string
	// Override the memory request on the clone
	MemoryRequest *string
	// Override the CPU limit on the clone
	CPULimit *string
	// Override the memory limit on the clone
	MemoryLimit *string
}

ClonePayload is the payload type of the workspaces service clone method.

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
	// Windows private root import settings
	VMOptions *VMOptions
	// 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
	// Mount /dev/shm as an emptyDir with medium=Memory (required for Chrome, ML
	// 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 CredentialsPayload added in v0.7.0

type CredentialsPayload struct {
	Name      string
	Namespace string
}

CredentialsPayload is the payload type of the workspaces service credentials method.

type DeletePayload

type DeletePayload struct {
	// Namespace
	Namespace string
	// Workspace name
	Name string
}

DeletePayload is the payload type of the workspaces service delete method.

type Endpoints

type Endpoints struct {
	Credentials goa.Endpoint
	List        goa.Endpoint
	Get         goa.Endpoint
	Create      goa.Endpoint
	Delete      goa.Endpoint
	Start       goa.Endpoint
	Stop        goa.Endpoint
	Reset       goa.Endpoint
	Clone       goa.Endpoint
}

Endpoints wraps the "workspaces" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "workspaces" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "workspaces" service endpoints.

type EnvVar

type EnvVar struct {
	// Environment variable name
	Name string
	// Environment variable value
	Value string
}

Custom environment variable for a workspace

type Forbidden added in v0.7.0

type Forbidden string

func (Forbidden) Error added in v0.7.0

func (e Forbidden) Error() string

Error returns an error description.

func (Forbidden) ErrorName deprecated added in v0.7.0

func (e Forbidden) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Forbidden) GoaErrorName added in v0.7.0

func (e Forbidden) GoaErrorName() string

GoaErrorName returns the error name.

type GetPayload

type GetPayload struct {
	// Namespace
	Namespace string
	// Workspace name
	Name string
}

GetPayload is the payload type of the workspaces service get method.

type ImageRemoteDesktop added in v0.5.0

type ImageRemoteDesktop struct {
	// Protocol name: "selkies" (Linux in-guest agent) or "agent" (cross-platform
	// kw-agent)
	Protocol string
	// Guest port the agent listens on
	Port int
	// Path relative to the agent's base URL
	Path string
}

In-guest remote desktop agent configuration

type Invalid

type Invalid string

Invalid workspace specification

func (Invalid) Error

func (e Invalid) Error() string

Error returns an error description.

func (Invalid) ErrorName deprecated

func (e Invalid) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Invalid) GoaErrorName

func (e Invalid) GoaErrorName() string

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

func (NotFound) Error

func (e NotFound) Error() string

Error returns an error description.

func (NotFound) ErrorName deprecated

func (e NotFound) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (NotFound) GoaErrorName

func (e NotFound) GoaErrorName() string

GoaErrorName returns the error name.

type ResetPayload added in v0.4.0

type ResetPayload struct {
	// Namespace
	Namespace string
	// Workspace name
	Name string
}

ResetPayload is the payload type of the workspaces service reset method.

type Service

type Service interface {
	// Retrieve this Windows workspace's unique initial credentials; namespace
	// editors/admins only
	Credentials(context.Context, *CredentialsPayload) (res *WorkspaceInitialCredentials, err error)
	// 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)
	// Clone an existing workspace under a new name, copying its spec and volume
	// mounts
	Clone(context.Context, *ClonePayload) (res *Workspace, err error)
}

Workspace management service

type StartPayload

type StartPayload struct {
	// Namespace
	Namespace string
	// Workspace name
	Name string
}

StartPayload is the payload type of the workspaces service start method.

type StopPayload

type StopPayload struct {
	// Namespace
	Namespace string
	// Workspace name
	Name string
}

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 Unavailable added in v0.7.0

type Unavailable string

func (Unavailable) Error added in v0.7.0

func (e Unavailable) Error() string

Error returns an error description.

func (Unavailable) ErrorName deprecated added in v0.7.0

func (e Unavailable) ErrorName() string

ErrorName returns the error name.

Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105

func (Unavailable) GoaErrorName added in v0.7.0

func (e Unavailable) GoaErrorName() string

GoaErrorName returns the error name.

type VMOptions added in v0.7.0

type VMOptions struct {
	// Same-namespace CDI accessKeyId/secretKey Secret
	ImportSecretName *string
	// Same-namespace registry CA ConfigMap
	ImportCertConfigMapName *string
	// Persistent root StorageClass; empty uses cluster default
	StorageClassName *string
	// Persistent Windows root capacity, at least 80Gi
	RootDiskSize *string
}

Namespaced Windows root import settings; credentials remain in Kubernetes Secrets

type VolumeMount

type VolumeMount struct {
	// Volume/PVC name
	Name string
	// Mount path in container
	MountPath string
	// Volume mount type for VMs: 'disk' (virtio disk) or 'cdrom' (optical disc).
	// Empty/omitted defaults to 'disk' for VM volume mounts.
	Type *string
	// Disk bus type for VMs when type is 'cdrom' (e.g. 'sata', 'ide'). Ignored for
	// 'disk' type.
	Bus *string
	// Whether the disk is read-only (for CD-ROMs, typically true).
	Readonly bool
}

Container PVC mount, or reusable CDI VM data disk with an absolute guest mount path

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
	// Remote desktop agent configuration (Tier 1)
	RemoteDesktop *ImageRemoteDesktop
	// Resolved guest profile; windows11-amd64-v1 uses display-only native
	// provisioning
	VMProfile *string
	// Windows native setup and bootstrap removal have completed
	Provisioned *bool
}

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

type WorkspaceInitialCredentials added in v0.7.0

type WorkspaceInitialCredentials struct {
	Username     string
	Password     string
	CacheControl string
}

WorkspaceInitialCredentials is the result type of the workspaces service credentials method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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