images

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 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 = "images"

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 = [2]string{"list", "create"}

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 "images".

func NewListEndpoint

func NewListEndpoint(s Service) goa.Endpoint

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

func NewViewedImage

func NewViewedImage(res *Image, view string) *imagesviews.Image

NewViewedImage initializes viewed result type Image from result type Image using the given view.

Types

type AlreadyExists

type AlreadyExists string

Image 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
	CreateEndpoint goa.Endpoint
}

Client is the "images" service client.

func NewClient

func NewClient(list, create goa.Endpoint) *Client

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

func (*Client) Create

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

Create calls the "create" endpoint of the "images" service. Create may return the following errors:

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

func (*Client) List

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

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

type CreateImagePayload

type CreateImagePayload struct {
	// Display name
	Name string
	// Container image reference
	Image string
	// Description of the image
	Description *string
	// Category for grouping (e.g. Desktop, IDE, Tool, Game)
	Category *string
	// Tags for filtering/searching images
	Tags []string
	// Default container port
	DefaultPort int
	// Default URL path for connecting
	DefaultPath *string
	// Icon identifier
	Icon *string
	// Default command-line args
	DefaultArgs []string
	// Default environment variables
	DefaultEnv []*ImageEnvVar
	// Run container in privileged mode
	Privileged bool
	// Project homepage or documentation URL
	HomepageURL *string
	// Source code repository URL
	SourceURL *string
	// Container image registry page (e.g. Docker Hub)
	ImageHomepageURL *string
	// Default user for this image
	DefaultUser *string
	// Known default password for DefaultUser. Only set when the image has a known
	// default password; leave unset when the guest uses no password
	DefaultPassword *string
	// Set to true when the image has cloud-init baked in, allowing user-data (e.g.
	// a user/password) to be seeded into the guest at first boot
	DefaultCloudInit *bool
	// Reserved user-data for the guest (cloud-init). Empty by default; later used
	// to seed first-boot configuration when cloud-init is supported. Not yet
	// consumed
	DefaultUserData *string
	// Default home directory for the default user
	DefaultHomedir *string
	// Default shell for exec/console sessions (e.g. /bin/bash)
	DefaultShell *string
	// Additional relevant URLs for this image
	Links []*ImageLink
	// Default login credentials for this image
	DefaultCredentials *ImageCredentials
	// Proxy behavior configuration
	ProxyConfig *ImageProxyConfig
	// Remote desktop agent configuration (Tier 1)
	RemoteDesktop *ImageRemoteDesktop
	// UID that the main container runs as (sets runAsUser and fsGroup)
	DefaultUID *int64
	// Automatically mount /dev/shm as emptyDir with medium=Memory (required for
	// Selkies streaming, Chrome, ML frameworks)
	DefaultSharedMemory *bool
	// Workspace types this image supports (container, vm, scratch). Empty means
	// container-only
	WorkspaceTypes []string
	// Controller-supported VM guest profile
	VMProfile *string
	// Import a per-workspace persistent root disk
	PersistentRootDisk *bool
	// Persistent root capacity
	PersistentRootDiskSize *string
	// Guest memory default
	MemoryLimit *string
	// Guest memory request default
	MemoryRequest *string
}

CreateImagePayload is the payload type of the images service create method.

type Endpoints

type Endpoints struct {
	List   goa.Endpoint
	Create goa.Endpoint
}

Endpoints wraps the "images" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type Image

type Image struct {
	// Kubernetes resource name (metadata.name)
	CrName string
	// Display name
	Name string
	// Full image reference
	Image string
	// Description of the image
	Description *string
	// Category for grouping (e.g. Desktop, IDE, Tool, Game)
	Category *string
	// Tags for filtering/searching images
	Tags []string
	// Default container port
	DefaultPort int
	// Default URL path for connecting (e.g. /vnc.html?resize=remote)
	DefaultPath *string
	// Proxy behavior configuration for this image
	ProxyConfig *ImageProxyConfig
	// Icon identifier
	Icon *string
	// Default command-line args injected at workspace creation
	DefaultArgs []string
	// Default environment variables injected at workspace creation
	DefaultEnv []*ImageEnvVar
	// UID that the main container runs as (sets runAsUser and fsGroup)
	DefaultUID *int64
	// Automatically mount /dev/shm as emptyDir with medium=Memory (required for
	// Selkies streaming, Chrome, ML frameworks)
	DefaultSharedMemory *bool
	// Run container in privileged mode
	Privileged *bool
	// Project homepage or documentation URL
	HomepageURL *string
	// Source code repository URL
	SourceURL *string
	// Container image registry page (e.g. Docker Hub)
	ImageHomepageURL *string
	// Default user for this image
	DefaultUser *string
	// Known default password for DefaultUser. Only set when the image has a known
	// default password; leave unset when the guest uses no password
	DefaultPassword *string
	// Set to true when the image has cloud-init baked in, allowing user-data (e.g.
	// a user/password) to be seeded into the guest at first boot
	DefaultCloudInit *bool
	// Reserved user-data for the guest (cloud-init). Empty by default; later used
	// to seed first-boot configuration when cloud-init is supported. Not yet
	// consumed
	DefaultUserData *string
	// Default home directory for the default user
	DefaultHomedir *string
	// Default shell for exec/console sessions (e.g. /bin/bash)
	DefaultShell *string
	// Additional relevant URLs for this image
	Links []*ImageLink
	// Default login credentials for this image
	DefaultCredentials *ImageCredentials
	// Remote desktop agent configuration (Tier 1)
	RemoteDesktop *ImageRemoteDesktop
	// Workspace types this image supports (container, vm, scratch). Empty means
	// container-only
	WorkspaceTypes []string
	// Controller-supported guest profile
	VMProfile              *string
	PersistentRootDisk     *bool
	PersistentRootDiskSize *string
	MemoryLimit            *string
	MemoryRequest          *string
}

Image is the result type of the images service create method.

func NewImage

func NewImage(vres *imagesviews.Image) *Image

NewImage initializes result type Image from viewed result type Image.

type ImageCredentials

type ImageCredentials struct {
	// Default username
	Username *string
	// Default password
	Password *string
}

Default login credentials for a workspace image

type ImageEnvVar

type ImageEnvVar struct {
	// Name of the environment variable
	Name string
	// Value (supports {{namespace}} and {{name}} placeholders)
	Value string
}

Environment variable with optional placeholder support

type ImageLink struct {
	// Display label for the link
	Title string
	// Link target URL
	URL string
}

A named URL link for an image

type ImageProxyConfig

type ImageProxyConfig struct {
	// Serve a no-op ServiceWorker at /sw.js to prevent SW registration errors
	NeedsNoopSw bool
	// Paths that use WebSocket (informational, all paths support WS transparently)
	WebsocketPaths []string
	// Rewrite requests with absolute paths that escape the proxy prefix using
	// Referer header
	RewriteHostAbsolutePaths bool
	// Additional headers to inject into proxied requests
	CustomRequestHeaders map[string]string
	// Inject a <base> tag into HTML responses to fix relative path resolution
	InjectBaseTag bool
	// Connect to backend over HTTPS with skip-verify (for self-signed certs)
	TLSInsecure bool
	// Forward the full proxy path (including /proxy/{ns}/{name}) to the pod
	// instead of stripping it. Required for apps configured with a base URL
	// matching the proxy prefix.
	PreservePathPrefix bool
}

Proxy configuration hints for a workspace image

type ImageRemoteDesktop added in v0.5.0

type ImageRemoteDesktop struct {
	// Protocol name (e.g. "selkies")
	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 image 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 Service

type Service interface {
	// List available workspace images
	List(context.Context) (res []*Image, err error)
	// Create a new image
	Create(context.Context, *CreateImagePayload) (res *Image, err error)
}

Available workspace images

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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