workspaces

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 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 = [6]string{"list", "get", "create", "delete", "start", "stop"}

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

func NewCreateEndpoint(s Service) goa.Endpoint

NewCreateEndpoint returns an endpoint function that calls the method "create" 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 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 {
	ListEndpoint   goa.Endpoint
	GetEndpoint    goa.Endpoint
	CreateEndpoint goa.Endpoint
	DeleteEndpoint goa.Endpoint
	StartEndpoint  goa.Endpoint
	StopEndpoint   goa.Endpoint
}

Client is the "workspaces" service client.

func NewClient

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

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

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) 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) 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 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
	// 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
	// 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 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 {
	List   goa.Endpoint
	Get    goa.Endpoint
	Create goa.Endpoint
	Delete goa.Endpoint
	Start  goa.Endpoint
	Stop   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 GetPayload

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

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

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

Workspace not found

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

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 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
	// 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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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