workspace

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MPL-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const ProjectLabel = "loft.sh/project"

Variables

View Source
var (
	ErrNoWorkspaceFound = errors.New("no workspace found")
)

Functions

func AddProvider

func AddProvider(
	devPodConfig *config.Config,
	providerName, providerSourceRaw string,
	log log.Logger,
) (*provider.ProviderConfig, error)

func AddProviderRaw

func AddProviderRaw(p ProviderParams) (*provider.ProviderConfig, error)

func Delete

func Delete(ctx context.Context, devPodConfig *config.Config, args []string, ignoreNotFound, force bool, deleteOptions client2.DeleteOptions, owner platform.OwnerFilter, log log.Logger) (string, error)

func Exists

func Exists(ctx context.Context, devPodConfig *config.Config, args []string, workspaceID string, owner platform.OwnerFilter, log log.Logger) string

Exists checks if the given workspace already exists

func FindProviderProInstance

func FindProviderProInstance(proInstances []*provider2.ProInstance, providerName string) (*provider2.ProInstance, bool)

func Get

func Get(ctx context.Context, devPodConfig *config.Config, args []string, changeLastUsed bool, owner platform.OwnerFilter, localOnly bool, log log.Logger) (client.BaseWorkspaceClient, error)

Get tries to retrieve an already existing workspace

func GetMachine

func GetMachine(devPodConfig *config.Config, args []string, log log.Logger) (client.MachineClient, error)

GetMachine creates a machine client

func List

func List(ctx context.Context, devPodConfig *config.Config, skipPro bool, owner platform.OwnerFilter, log log.Logger) ([]*providerpkg.Workspace, error)

func ListLocalWorkspaces

func ListLocalWorkspaces(contextName string, skipPro bool, log log.Logger) ([]*providerpkg.Workspace, error)

func ListProInstances

func ListProInstances(devPodConfig *config.Config, log log.Logger) ([]*provider2.ProInstance, error)

func LoadAllProviders

func LoadAllProviders(devPodConfig *config.Config, log log.Logger) (map[string]*ProviderWithOptions, error)

func MachineExists

func MachineExists(devPodConfig *config.Config, args []string) string

MachineExists checks if the given workspace already exists

func ProviderFromHost

func ProviderFromHost(
	ctx context.Context,
	devPodConfig *config.Config,
	proHost string,
	log log.Logger,
) (*provider.ProviderConfig, error)

func Resolve

func Resolve(
	ctx context.Context,
	devPodConfig *config.Config,
	params ResolveParams,
	log log.Logger,
) (client.BaseWorkspaceClient, error)

func ResolveMachine

func ResolveMachine(devPodConfig *config.Config, args []string, userOptions []string, log log.Logger) (client.Client, error)

func ResolveProvider

func ResolveProvider(providerSource string, log log.Logger) ([]byte, *provider.ProviderSource, error)

func ResolveProviderSource

func ResolveProviderSource(devPodConfig *config.Config, providerName string, log log.Logger) (string, error)

func SingleMachineName

func SingleMachineName(devPodConfig *config.Config, provider string, log log.Logger) string

func ToID

func ToID(str string) string

func UpdateProvider

func UpdateProvider(
	devPodConfig *config.Config,
	providerName, providerSourceRaw string,
	log log.Logger,
) (*provider.ProviderConfig, error)

Types

type ProviderParams added in v0.12.1

type ProviderParams struct {
	DevPodConfig *config.Config
	ProviderName string
	Raw          []byte
	Source       *provider.ProviderSource
	Log          log.Logger
}

type ProviderWithOptions

type ProviderWithOptions struct {
	Config *provider.ProviderConfig `json:"config,omitempty"`
	State  *config.ProviderConfig   `json:"state,omitempty"`
}

func CloneProvider

func CloneProvider(
	devPodConfig *config.Config,
	providerName, providerSourceRaw string,
	log log.Logger,
) (*ProviderWithOptions, error)

func FindProvider

func FindProvider(devPodConfig *config.Config, name string, log log.Logger) (*ProviderWithOptions, error)

func LoadProviders

func LoadProviders(
	devPodConfig *config.Config,
	log log.Logger,
) (*ProviderWithOptions, map[string]*ProviderWithOptions, error)

LoadProviders loads all known providers for the given context.

type RemoteCreator added in v0.12.2

type RemoteCreator interface {
	Create(ctx context.Context, stdin io.Reader, stdout, stderr io.Writer) error
}

RemoteCreator defines the interface for clients that support remote workspace creation. This interface is implemented by ProxyClient and DaemonClient to enable workspace creation on remote platforms.

type ResolveParams added in v0.9.5

type ResolveParams struct {
	IDE                  string
	IDEOptions           []string
	Args                 []string
	DesiredID            string
	DesiredMachine       string
	ProviderUserOptions  []string
	ReconfigureProvider  bool
	DevContainerImage    string
	DevContainerPath     string
	SSHConfigPath        string
	SSHConfigIncludePath string
	Source               *providerpkg.WorkspaceSource
	UID                  string
	ChangeLastUsed       bool
	Owner                platform.OwnerFilter
}

Resolve takes the `devpod up|build` CLI input and either finds an existing workspace or creates a new one

Jump to

Keyboard shortcuts

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