views

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ImageMap is a map indexing the attribute names of Image by view name.
	ImageMap = map[string][]string{
		"default": {
			"cr_name",
			"name",
			"image",
			"description",
			"category",
			"tags",
			"default_port",
			"default_path",
			"proxy_config",
			"icon",
			"default_args",
			"default_env",
			"default_uid",
			"default_shared_memory",
			"privileged",
			"homepage_url",
			"source_url",
			"image_homepage_url",
			"default_user",
			"default_password",
			"default_cloud_init",
			"default_user_data",
			"default_homedir",
			"default_shell",
			"links",
			"default_credentials",
			"remote_desktop",
			"workspace_types",
			"vm_profile",
			"persistent_root_disk",
			"persistent_root_disk_size",
			"memory_limit",
			"memory_request",
		},
	}
)

Functions

func ValidateImage

func ValidateImage(result *Image) (err error)

ValidateImage runs the validations defined on the viewed result type Image.

func ValidateImageCredentialsView

func ValidateImageCredentialsView(result *ImageCredentialsView) (err error)

ValidateImageCredentialsView runs the validations defined on ImageCredentialsView.

func ValidateImageEnvVarView

func ValidateImageEnvVarView(result *ImageEnvVarView) (err error)

ValidateImageEnvVarView runs the validations defined on ImageEnvVarView.

func ValidateImageLinkView

func ValidateImageLinkView(result *ImageLinkView) (err error)

ValidateImageLinkView runs the validations defined on ImageLinkView.

func ValidateImageProxyConfigView

func ValidateImageProxyConfigView(result *ImageProxyConfigView) (err error)

ValidateImageProxyConfigView runs the validations defined on ImageProxyConfigView.

func ValidateImageRemoteDesktopView added in v0.5.0

func ValidateImageRemoteDesktopView(result *ImageRemoteDesktopView) (err error)

ValidateImageRemoteDesktopView runs the validations defined on ImageRemoteDesktopView.

func ValidateImageView

func ValidateImageView(result *ImageView) (err error)

ValidateImageView runs the validations defined on ImageView using the "default" view.

Types

type Image

type Image struct {
	// Type to project
	Projected *ImageView
	// View to render
	View string
}

Image is the viewed result type that is projected based on a view.

type ImageCredentialsView

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

ImageCredentialsView is a type that runs validations on a projected type.

type ImageEnvVarView

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

ImageEnvVarView is a type that runs validations on a projected type.

type ImageLinkView

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

ImageLinkView is a type that runs validations on a projected type.

type ImageProxyConfigView

type ImageProxyConfigView 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
}

ImageProxyConfigView is a type that runs validations on a projected type.

type ImageRemoteDesktopView added in v0.5.0

type ImageRemoteDesktopView 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
}

ImageRemoteDesktopView is a type that runs validations on a projected type.

type ImageView

type ImageView 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 *ImageProxyConfigView
	// Icon identifier
	Icon *string
	// Default command-line args injected at workspace creation
	DefaultArgs []string
	// Default environment variables injected at workspace creation
	DefaultEnv []*ImageEnvVarView
	// 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 []*ImageLinkView
	// Default login credentials for this image
	DefaultCredentials *ImageCredentialsView
	// Remote desktop agent configuration (Tier 1)
	RemoteDesktop *ImageRemoteDesktopView
	// 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
}

ImageView is a type that runs validations on a projected type.

Jump to

Keyboard shortcuts

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