types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package types defines shared types used by the CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFunction

func GetFunction[T any](
	resourceType string,
	metadata []FunctionMetadata[T],
) (T, bool)

GetFunction returns the function bound to a resource type.

func SupportedResourceTypes

func SupportedResourceTypes[T any](metadata []FunctionMetadata[T]) []string

SupportedResourceTypes returns the plural form of the resources represented by the given FunctionMetadata slice. The returned slice is sorted by the singular name so that error messages line up with the order of the commands which are sorted by the singular name.

Types

type Application

type Application struct {
	ID          string   `json:"id,omitempty"`
	Description string   `json:"description,omitempty"`
	DisplayName string   `json:"display_name,omitempty"`
	DataplaneID string   `json:"dataplane_id,omitempty"`
	Services    []string `json:"services,omitempty"`
}

Application represents an application.

func AsApplicationSlice

func AsApplicationSlice(source Applications) []Application

AsApplicationSlice converts Applications to a plain slice.

type Applications

type Applications []Application

Applications is a slice of Application values.

type Auth0User

type Auth0User struct {
	Version           int            `json:"version,omitempty"`
	ID                string         `json:"id,omitempty"`
	DatabaseID        string         `json:"databaseId,omitempty"`
	Name              string         `json:"name,omitempty"`
	Email             string         `json:"email,omitempty"`
	CreationTimeStamp time.Time      `json:"creationTimeStamp,omitempty"`
	Roles             []Role         `json:"roles,omitempty"`
	UserMetadata      map[string]any `json:"userMetadata,omitempty"`
}

Auth0User is the representation of a user in the auth0Admin service.

type Auth0UserList

type Auth0UserList struct {
	Version int         `json:"version"`
	Accept  string      `json:"accept"`
	Count   int         `json:"count"`
	Start   int         `json:"start"`
	Limit   int         `json:"limit"`
	Name    string      `json:"name"`
	Items   []Auth0User `json:"items"`
}

Auth0UserList is the representation of a list of users in the auth0Admin service.

type CapabilityVolumeSource

type CapabilityVolumeSource struct {
	Name       string `json:"name"`
	PullPolicy string `json:"pullPolicy,omitempty"`
}

CapabilityVolumeSource identifies a capability to be mounted into a Job or Workbench.

type Config

type Config struct {
	Endpoint string `json:"endpoint,omitempty"`
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Output   string `json:"output,omitempty"`
}

Config holds CLI configuration values.

type Conflict

type Conflict struct {
	ConflictControllerID  string `json:"conflict_controller_id,omitempty"`
	ConflictID            string `json:"conflict_id,omitempty"`
	ConflictName          string `json:"conflict_name,omitempty"`
	ConflictNodeID        string `json:"conflict_node_id,omitempty"`
	ConflictType          string `json:"conflict_type,omitempty"`
	ControllerID          string `json:"controller_id,omitempty"`
	ID                    string `json:"id,omitempty"`
	Name                  string `json:"name,omitempty"`
	NodeID                string `json:"node_id,omitempty"`
	Type                  string `json:"type,omitempty"`
	WorkspaceControllerID string `json:"workspace_controller_id,omitempty" wbctl:"alias:volume_controller_id"`
	WorkspaceID           string `json:"workspace_id,omitempty" wbctl:"alias:volume_id"`
	WorkspaceName         string `json:"workspace_name,omitempty" wbctl:"alias:volume_name"`
}

Conflict represents a conflict record.

func AsConflictSlice

func AsConflictSlice(source Conflicts) []Conflict

AsConflictSlice converts Conflicts to a plain slice.

type Conflicts

type Conflicts []Conflict

Conflicts is a slice of Conflict values.

type Dataplane

type Dataplane struct {
	ID          string                 `json:"id,omitempty"`
	CreatedBy   string                 `json:"created_by,omitempty"`
	ModifiedBy  string                 `json:"modified_by,omitempty"`
	CreatedAt   *time.Time             `json:"created_at,omitempty"`
	ModifiedAt  *time.Time             `json:"modified_at,omitempty"`
	Name        string                 `json:"name,omitempty"`
	Description string                 `json:"description,omitempty"`
	Spec        map[string]interface{} `json:"spec,omitempty"`
	Properties  map[string]interface{} `json:"properties,omitempty"`
	State       string                 `json:"state,omitempty"`
	Message     string                 `json:"message,omitempty"`
}

Dataplane represents a dataplane.

type Dataplanes

type Dataplanes []Dataplane

Dataplanes is a slice of Dataplane values.

type Event

type Event struct {
	ID           string     `json:"id,omitempty"`
	Action       string     `json:"action,omitempty"`
	CreatedAt    *time.Time `json:"created_at,omitempty"`
	Kind         string     `json:"kind,omitempty"`
	Note         string     `json:"note,omitempty"`
	Reason       string     `json:"reason,omitempty"`
	ResourceType string     `json:"resource_type,omitempty"`
	Type         string     `json:"type,omitempty"`
}

Event represents an event.

func AsEventSlice

func AsEventSlice(source Events) []Event

AsEventSlice converts Events to a plain slice.

type Events

type Events []Event

Events is a slice of Event values.

type ExecuteableResourceStatus

type ExecuteableResourceStatus struct {
	Name    string           `json:"name,omitempty"`
	Deleted bool             `json:"deleted,omitempty"`
	NodeID  string           `json:"nodeId,omitempty"`
	Status  corev1.PodStatus `json:"status,omitempty"`
}

ExecuteableResourceStatus describes a resource's execution status.

type FunctionMetadata

type FunctionMetadata[T any] struct {
	Singular string
	Plural   string
	F        T
}

FunctionMetadata binds resource names to implementations.

type Image

type Image struct {
	Context                      string                      `json:"context,omitempty" wbctl:"editable"`
	ControllerID                 string                      `json:"controller_id,omitempty"`
	CreatedAt                    *time.Time                  `json:"created_at,omitempty"`
	CreatedBy                    string                      `json:"created_by,omitempty"`
	CurrentState                 string                      `json:"current_state,omitempty"`
	DataplaneID                  string                      `json:"dataplane_id,omitempty" wbctl:"editable"`
	Description                  string                      `json:"description,omitempty" wbctl:"editable"`
	Email                        string                      `json:"email,omitempty"`
	ID                           string                      `json:"id,omitempty"`
	ImageName                    string                      `json:"image_name,omitempty" wbctl:"editable"`
	ImageRegistry                string                      `json:"image_registry,omitempty" wbctl:"editable"`
	ImageTag                     string                      `json:"image_tag,omitempty" wbctl:"editable"`
	Labels                       map[string]string           `json:"labels,omitempty" wbctl:"editable"`
	LatestImageBuildControllerID string                      `json:"latest_image_build_controller_id,omitempty"`
	LatestImageBuildID           string                      `json:"latest_image_build_id,omitempty"`
	Message                      string                      `json:"message,omitempty"`
	ModifiedAt                   *time.Time                  `json:"modified_at,omitempty"`
	ModifiedBy                   string                      `json:"modified_by,omitempty"`
	Name                         string                      `json:"name,omitempty" wbctl:"editable"`
	PodStatus                    []ExecuteableResourceStatus `json:"pod_status,omitempty"`
	Spec                         map[string]interface{}      `json:"spec,omitempty" wbctl:"editable"`
	SubPath                      string                      `json:"sub_path,omitempty" wbctl:"editable"`
	TenantID                     string                      `json:"tenant_id,omitempty"`
	Username                     string                      `json:"username,omitempty"`
}

Image represents an image.

func AsImageSlice

func AsImageSlice(source Images) []Image

AsImageSlice converts Images to a plain slice.

type ImageBuild

type ImageBuild struct {
	ID           string                      `json:"id,omitempty"`
	Name         string                      `json:"name,omitempty"`
	ControllerID string                      `json:"controller_id,omitempty"`
	CreatedAt    *time.Time                  `json:"created_at,omitempty"`
	CreatedBy    string                      `json:"created_by,omitempty"`
	DataplaneID  string                      `json:"dataplane_id,omitempty"`
	ImageID      string                      `json:"image_id,omitempty"`
	ModifiedBy   string                      `json:"modified_by,omitempty"`
	LogURL       string                      `json:"log_url,omitempty"`
	PodStatus    []ExecuteableResourceStatus `json:"pod_status,omitempty"`
}

ImageBuild represents an image build.

func AsImageBuildSlice

func AsImageBuildSlice(source ImageBuilds) []ImageBuild

AsImageBuildSlice converts ImageBuilds to a plain slice.

type ImageBuildLog

type ImageBuildLog struct {
	BuildID       string     `json:"build_id,omitempty"`
	ContainerName string     `json:"container_name,omitempty"`
	ControllerID  string     `json:"controller_id,omitempty"`
	CreatedAt     *time.Time `json:"created_at,omitempty"`
	CreatedBy     string     `json:"created_by,omitempty"`
	DataplaneID   string     `json:"dataplane_id,omitempty"`
	Log           string     `json:"log,omitempty"`
}

ImageBuildLog represents an image build log entry.

func AsImageBuildLogSlice

func AsImageBuildLogSlice(source ImageBuildLogs) []ImageBuildLog

AsImageBuildLogSlice converts ImageBuildLogs to a plain slice.

type ImageBuildLogs

type ImageBuildLogs []ImageBuildLog

ImageBuildLogs is a slice of ImageBuildLog values.

type ImageBuilds

type ImageBuilds []ImageBuild

ImageBuilds is a slice of ImageBuild values.

type Images

type Images []Image

Images is a slice of Image values.

type Initializer

type Initializer struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	DataplaneID string `json:"dataplane_id,omitempty"`
}

Initializer represents a workspace initializer.

func AsInitializerSlice

func AsInitializerSlice(source Initializers) []Initializer

AsInitializerSlice converts Initializers to a plain slice.

type Initializers

type Initializers []Initializer

Initializers is a slice of Initializer values.

type Job

type Job struct {
	ApplicationID             string                 `json:"application_id,omitempty" wbctl:"editable"`
	Context                   string                 `json:"context,omitempty" wbctl:"editable"`
	CreatedAt                 *time.Time             `json:"created_at,omitempty"`
	CreatedBy                 string                 `json:"created_by,omitempty"`
	DataplaneID               string                 `json:"dataplane_id,omitempty" wbctl:"editable"`
	Description               string                 `json:"description,omitempty" wbctl:"editable"`
	Email                     string                 `json:"email,omitempty"`
	ID                        string                 `json:"id,omitempty"`
	Labels                    map[string]string      `json:"labels,omitempty" wbctl:"editable"`
	ModifiedAt                *time.Time             `json:"modified_at,omitempty"`
	ModifiedBy                string                 `json:"modified_by,omitempty"`
	MostRecentJobSubmissionAt *time.Time             `json:"most_recent_job_submission_at,omitempty"`
	MostRecentJobSubmissionID string                 `json:"most_recent_job_submission_id,omitempty"`
	Name                      string                 `json:"name,omitempty" wbctl:"editable"`
	Nodepool                  string                 `json:"nodepool,omitempty" wbctl:"editable"`
	Properties                map[string]interface{} `json:"properties,omitempty" wbctl:"editable"`
	Schedule                  string                 `json:"schedule,omitempty" wbctl:"editable"`
	Services                  []ServiceRequest       `json:"services,omitempty" wbctl:"editable"`
	Spec                      map[string]interface{} `json:"spec,omitempty" wbctl:"editable"`
	SubPath                   string                 `json:"sub_path,omitempty" wbctl:"editable"`
	TenantID                  string                 `json:"tenant_id,omitempty"`
	Username                  string                 `json:"username,omitempty"`
	WorkspaceNames            map[string]string      `json:"workspace_names,omitempty" wbctl:"alias:volume_names"`
	Workspaces                []WorkspaceRequest     `json:"workspaces,omitempty" wbctl:"alias:volumes,editable"`
	Mounts                    []MountRequest         `json:"mounts,omitempty" wbctl:"alias:volumes,editable"`
}

Job represents a scheduled or ad hoc job.

func AsJobSlice

func AsJobSlice(source Jobs) []Job

AsJobSlice converts Jobs to a plain slice.

type JobSubmission

type JobSubmission struct {
	ID           string                      `json:"id,omitempty"`
	CreatedBy    string                      `json:"created_by,omitempty"`
	ModifiedBy   string                      `json:"modified_by,omitempty"`
	CreatedAt    *time.Time                  `json:"created_at,omitempty"`
	ModifiedAt   *time.Time                  `json:"modified_at,omitempty"`
	TenantID     string                      `json:"tenant_id,omitempty"`
	DataplaneID  string                      `json:"dataplane_id,omitempty"`
	JobID        string                      `json:"job_id,omitempty"`
	JobName      string                      `json:"job_name,omitempty"`
	Env          map[string]string           `json:"env,omitempty"`
	Workspaces   []WorkspaceRequest          `json:"workspaces,omitempty" wbctl:"alias:volumes"`
	Labels       map[string]string           `json:"labels,omitempty"`
	Nodepool     string                      `json:"nodepool,omitempty"`
	ControllerID string                      `json:"controller_id,omitempty"`
	URL          string                      `json:"url,omitempty"`
	CurrentState string                      `json:"current_state,omitempty"`
	Message      string                      `json:"message,omitempty"`
	PodStatus    []ExecuteableResourceStatus `json:"pod_status,omitempty"`
	Email        string                      `json:"email,omitempty"`
	Username     string                      `json:"username,omitempty"`
	CanceledAt   *time.Time                  `json:"canceled_at,omitempty"`
	CompletedAt  *time.Time                  `json:"completed_at,omitempty"`
	Runtime      float64                     `json:"runtime,omitempty"`
	Properties   map[string]interface{}      `json:"properties,omitempty"`
	Scheduled    bool                        `json:"scheduled,omitempty"`
	LogURL       string                      `json:"log_url,omitempty"`
}

JobSubmission represents a job submission record.

func AsJobSubmissionSlice

func AsJobSubmissionSlice(source JobSubmissions) []JobSubmission

AsJobSubmissionSlice converts JobSubmissions to a plain slice.

func AsNodepoolSlice

func AsNodepoolSlice(source JobSubmissions) []JobSubmission

AsNodepoolSlice converts JobSubmissions to a plain slice.

type JobSubmissions

type JobSubmissions []JobSubmission

JobSubmissions is a slice of JobSubmission values.

type Jobs

type Jobs []Job

Jobs is a slice of Job values.

type MountRequest

type MountRequest struct {
	MountPath    string        `json:"mountPath,omitempty"`
	VolumeSource *VolumeSource `json:"volumeSource,omitempty"`
}

MountRequest identifies a mount path and volume source to be mounted into a Job or Workbench.

type Nodepool

type Nodepool struct {
	ID          string `json:"id,omitempty"`
	DisplayName string `json:"display_name,omitempty"`
	DataplaneID string `json:"dataplane_id,omitempty"`
	Description string `json:"description,omitempty"`
}

Nodepool represents a node pool.

type Nodepools

type Nodepools []Nodepool

Nodepools is a slice of Nodepool values.

type PVCStatus

type PVCStatus struct {
	Deleted bool                               `json:"deleted,omitempty"`
	Status  corev1.PersistentVolumeClaimStatus `json:"status,omitempty"`
}

PVCStatus describes a persistent volume claim status.

type Ping

type Ping struct {
	DataplaneID string     `json:"dataplane_id,omitempty"`
	RequestAt   *time.Time `json:"request_at,omitempty"`
	ResponseAt  *time.Time `json:"status_updated_at,omitempty"`
	State       string     `json:"status_state,omitempty"`
	Message     string     `json:"status_message,omitempty"`
}

Ping represents a ping response.

func AsPingSlice

func AsPingSlice(source Pings) []Ping

AsPingSlice converts Pings to a plain slice.

type Pings

type Pings []Ping

Pings is a slice of Ping values.

type Role

type Role struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

Role represents a role.

type Service

type Service struct {
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	Type        string `json:"type,omitempty"`
	DataplaneID string `json:"dataplane_id,omitempty"`
}

Service represents a service.

func AsServiceSlice

func AsServiceSlice(source Services) []Service

AsServiceSlice converts Services to a plain slice.

type ServiceRequest

type ServiceRequest struct {
	ID    string            `json:"id,omitempty"`
	Env   map[string]string `json:"env,omitempty"`
	Image string            `json:"image,omitempty"`
}

ServiceRequest describes a service request payload.

type Services

type Services []Service

Services is a slice of Service values.

type Settings

type Settings map[string]any

Settings is a slice of Setting values.

type Snapshot

type Snapshot struct {
	ControllerID    string                        `json:"controller_id,omitempty"`
	CreatedAt       *time.Time                    `json:"created_at,omitempty"`
	CreatedBy       string                        `json:"created_by,omitempty"`
	DataplaneID     string                        `json:"dataplane_id,omitempty" wbctl:"editable"`
	Description     string                        `json:"description,omitempty" wbctl:"editable"`
	Email           string                        `json:"email,omitempty"`
	ID              string                        `json:"id,omitempty"`
	Message         string                        `json:"message,omitempty"`
	ModifiedAt      *time.Time                    `json:"modified_at,omitempty"`
	ModifiedBy      string                        `json:"modified_by,omitempty"`
	Name            string                        `json:"name,omitempty" wbctl:"editable"`
	Properties      map[string]interface{}        `json:"properties,omitempty" wbctl:"editable"`
	Spec            *snapshot1.VolumeSnapshotSpec `json:"spec,omitempty" wbctl:"editable"`
	State           string                        `json:"state,omitempty"`
	TenantID        string                        `json:"tenant_id,omitempty"`
	Username        string                        `json:"username,omitempty"`
	VolumeStatus    *VolumeStatus                 `json:"volume_status,omitempty"`
	WorkspaceSource *Workspace                    `json:"workspace_source,omitempty" wbctl:"alias:volume_source"`
}

Snapshot represents a snapshot.

func AsSnapshotSlice

func AsSnapshotSlice(source Snapshots) []Snapshot

AsSnapshotSlice converts Snapshots to a plain slice.

type Snapshots

type Snapshots []Snapshot

Snapshots is a slice of Snapshot values.

type StorageClass

type StorageClass struct {
	ID          string                 `json:"id,omitempty"`
	DisplayName string                 `json:"display_name,omitempty"`
	Description string                 `json:"description,omitempty"`
	AccessMode  string                 `json:"access_mode,omitempty"`
	DataplaneID string                 `json:"dataplane_id,omitempty"`
	Properties  map[string]interface{} `json:"properties,omitempty"`
}

StorageClass represents a storage class.

type StorageClasses

type StorageClasses []StorageClass

StorageClasses is a slice of StorageClass values.

type VolumeSource

type VolumeSource struct {
	corev1.VolumeSource `json:",inline"`
	Capability          *CapabilityVolumeSource `json:"capability,omitempty"`
}

VolumeSource is a corev1.VolumeSource with an additional volume source that supports a Workbench capability mount.

type VolumeStatus

type VolumeStatus struct {
	Name    string                         `json:"name,omitempty"`
	Deleted bool                           `json:"deleted,omitempty"`
	Status  snapshot1.VolumeSnapshotStatus `json:"status,omitempty"`
}

VolumeStatus describes a snapshot volume status.

type Workbench

type Workbench struct {
	ID             string                      `json:"id,omitempty"`
	ApplicationID  string                      `json:"application_id,omitempty" wbctl:"editable"`
	ControllerID   string                      `json:"controller_id,omitempty"`
	CreatedAt      *time.Time                  `json:"created_at,omitempty"`
	CreatedBy      string                      `json:"created_by,omitempty"`
	CurrentState   string                      `json:"current_state,omitempty"`
	DataplaneID    string                      `json:"dataplane_id,omitempty" wbctl:"editable"`
	DesiredState   string                      `json:"desired_state,omitempty"` // On get
	Email          string                      `json:"email,omitempty"`
	Labels         map[string]string           `json:"labels,omitempty" wbctl:"editable"`
	Message        string                      `json:"message,omitempty"`
	ModifiedAt     *time.Time                  `json:"modified_at,omitempty"`
	ModifiedBy     string                      `json:"modified_by,omitempty"`
	Name           string                      `json:"name,omitempty" wbctl:"editable"`
	Nodepool       string                      `json:"nodepool,omitempty" wbctl:"editable"`
	PodStatus      []ExecuteableResourceStatus `json:"pod_status,omitempty"`
	PodStatusAt    *time.Time                  `json:"pod_status_at,omitempty"`
	Properties     map[string]interface{}      `json:"properties,omitempty" wbctl:"editable"`
	Services       []ServiceRequest            `json:"services,omitempty" wbctl:"editable"`
	State          string                      `json:"state,omitempty" wbctl:"editable,seedfield:DesiredState"`
	URL            string                      `json:"url,omitempty"`
	Username       string                      `json:"username,omitempty"`
	WorkspaceNames map[string]string           `json:"workspace_names,omitempty" wbctl:"alias:volume_names"`
	Workspaces     []WorkspaceRequest          `json:"workspaces,omitempty" wbctl:"alias:volumes,editable"`
	Mounts         []MountRequest              `json:"mounts,omitempty" wbctl:"alias:volumes,editable"`
}

Workbench represents a workbench.

func AsWorkbenchSlice

func AsWorkbenchSlice(source Workbenches) []Workbench

AsWorkbenchSlice converts Workbenches to a plain slice.

type Workbenches

type Workbenches []Workbench

Workbenches is a slice of Workbench values.

type Workspace

type Workspace struct {
	ControllerID string                            `json:"controller_id,omitempty"`
	CreatedAt    *time.Time                        `json:"created_at,omitempty"`
	CreatedBy    string                            `json:"created_by,omitempty"`
	DataplaneID  string                            `json:"dataplane_id,omitempty" wbctl:"editable"`
	Description  string                            `json:"description,omitempty" wbctl:"editable"`
	Email        string                            `json:"email,omitempty"`
	ID           string                            `json:"id,omitempty"`
	Initializers []ServiceRequest                  `json:"initializers,omitempty" wbctl:"editable"`
	Message      string                            `json:"message,omitempty"`
	ModifiedAt   *time.Time                        `json:"modified_at,omitempty"`
	ModifiedBy   string                            `json:"modified_by,omitempty"`
	Name         string                            `json:"name,omitempty" wbctl:"editable"`
	PVCStatus    PVCStatus                         `json:"pvc_status,omitempty"`
	PodStatus    []ExecuteableResourceStatus       `json:"pod_status,omitempty"`
	PodStatusAt  *time.Time                        `json:"pod_status_at,omitempty"`
	Properties   map[string]interface{}            `json:"properties,omitempty" wbctl:"editable"`
	State        string                            `json:"state,omitempty"`
	StorageSizeG float64                           `json:"storage_size_g,omitempty"`
	StorageSpec  *corev1.PersistentVolumeClaimSpec `json:"storage_spec,omitempty" wbctl:"editable"`
	StorageType  string                            `json:"storage_type,omitempty" wbctl:"editable"`
	Username     string                            `json:"username,omitempty"`
}

Workspace represents a workspace.

func AsWorkspaceSlice

func AsWorkspaceSlice(source Workspaces) []Workspace

AsWorkspaceSlice converts Workspaces to a plain slice.

type WorkspaceRequest

type WorkspaceRequest struct {
	ID           string                            `json:"id,omitempty"`
	MountName    string                            `json:"mountName,omitempty"`
	EphemeralPVC *corev1.PersistentVolumeClaimSpec `json:"ephemeralPVC,omitempty"`
}

WorkspaceRequest describes a workspace request payload.

type WorkspaceRequestWithMetadata

type WorkspaceRequestWithMetadata struct {
	WorkspaceRequest
	HomeDir bool
	DbID    string
}

WorkspaceRequestWithMetadata wraps a workspace request with home directory and db id metadata.

type Workspaces

type Workspaces []Workspace

Workspaces is a slice of Workspace values.

Jump to

Keyboard shortcuts

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