client

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MPL-2.0 Imports: 6 Imported by: 20

Documentation

Index

Constants

View Source
const (
	StatusRunning  = "Running"
	StatusBusy     = "Busy"
	StatusStopped  = "Stopped"
	StatusNotFound = "NotFound"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Provider returns the name of the provider
	Provider() string

	// Context returns the context of the provider
	Context() string

	// RefreshOptions updates the options
	RefreshOptions(ctx context.Context, userOptions []string) error

	// AgentPath returns the agent path
	AgentPath() string

	// AgentURL returns the agent download url
	AgentURL() string

	// Create creates a new workspace
	Create(ctx context.Context, options CreateOptions) error

	// Delete deletes the workspace
	Delete(ctx context.Context, options DeleteOptions) error

	// Start starts the workspace
	Start(ctx context.Context, options StartOptions) error

	// Stop stops the workspace
	Stop(ctx context.Context, options StopOptions) error

	// Status retrieves the workspace status
	Status(ctx context.Context, options StatusOptions) (Status, error)

	// Command creates an SSH tunnel into the workspace
	Command(ctx context.Context, options CommandOptions) error
}

type CommandOptions

type CommandOptions struct {
	Command string
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
}

type CreateOptions

type CreateOptions struct{}

type DeleteOptions

type DeleteOptions struct {
	Force       bool
	GracePeriod *time.Duration
}

type InitOptions

type InitOptions struct{}

type MachineClient

type MachineClient interface {
	Client

	// Machine returns the machine of this client
	Machine() string

	// MachineConfig returns the machine config
	MachineConfig() *provider.Machine
}

type StartOptions

type StartOptions struct{}

type Status

type Status string

func ParseStatus

func ParseStatus(in string) (Status, error)

type StatusOptions

type StatusOptions struct {
	ContainerStatus bool
}

type StopOptions

type StopOptions struct{}

type ValidateOptions

type ValidateOptions struct{}

type WorkspaceClient

type WorkspaceClient interface {
	Client

	// Workspace returns the workspace of this provider
	Workspace() string

	// WorkspaceConfig returns the workspace config
	WorkspaceConfig() *provider.Workspace

	// AgentConfig returns the agent config to send to the agent
	AgentConfig() provider.ProviderAgentConfig

	// AgentInfo returns the info to send to the agent
	AgentInfo() (string, *provider.AgentWorkspaceInfo, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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