workspace

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWorkspaceNotFound = errors.New("workspace not found")
)

Functions

func GetProjectEnvVars

func GetProjectEnvVars(project *Project, params ProjectEnvVarParams, telemetryEnabled bool) map[string]string

func GetProjectHostname added in v0.12.1

func GetProjectHostname(workspaceId string, projectName string) string

func GetWorkspaceEnvVars added in v0.15.0

func GetWorkspaceEnvVars(workspace *Workspace, params WorkspaceEnvVarParams, telemetryEnabled bool) map[string]string

func IsWorkspaceNotFound added in v0.18.0

func IsWorkspaceNotFound(err error) bool

Types

type FileStatus added in v0.15.0

type FileStatus struct {
	Name     string `json:"name"`
	Extra    string `json:"extra"`
	Staging  Status `json:"staging"`
	Worktree Status `json:"worktree"`

} // @name FileStatus

type GitStatus added in v0.15.0

type GitStatus struct {
	CurrentBranch string        `json:"currentBranch"`
	Files         []*FileStatus `json:"fileStatus"`

} // @name GitStatus

type Project

type Project struct {
	Name        string                     `json:"name"`
	Image       string                     `json:"image"`
	User        string                     `json:"user"`
	Build       *ProjectBuild              `json:"build"`
	Repository  *gitprovider.GitRepository `json:"repository"`
	WorkspaceId string                     `json:"workspaceId"`
	ApiKey      string                     `json:"-"`
	Target      string                     `json:"target"`
	EnvVars     map[string]string          `json:"-"`
	State       *ProjectState              `json:"state,omitempty"`

} // @name Project

func (*Project) GetConfigHash added in v0.17.0

func (p *Project) GetConfigHash() (string, error)

GetConfigHash returns a SHA-256 hash of the project's build configuration, repository URL, and environment variables.

type ProjectBuild added in v0.17.0

type ProjectBuild struct {
	Devcontainer *ProjectBuildDevcontainer `json:"devcontainer"`

} // @name ProjectBuild

type ProjectBuildDevcontainer added in v0.17.0

type ProjectBuildDevcontainer struct {
	DevContainerFilePath string `json:"devContainerFilePath"`

} // @name ProjectBuildDevcontainer

type ProjectEnvVarParams added in v0.23.0

type ProjectEnvVarParams struct {
	ApiUrl    string
	ServerUrl string
	ClientId  string
}

type ProjectInfo

type ProjectInfo struct {
	Name             string `json:"name"`
	Created          string `json:"created"`
	IsRunning        bool   `json:"isRunning"`
	ProviderMetadata string `json:"providerMetadata,omitempty"`
	WorkspaceId      string `json:"workspaceId"`

} // @name ProjectInfo

type ProjectState

type ProjectState struct {
	UpdatedAt string     `json:"updatedAt"`
	Uptime    uint64     `json:"uptime"`
	GitStatus *GitStatus `json:"gitStatus"`

} // @name ProjectState

type Status added in v0.15.0

type Status string // @name Status

Status status code of a file in the Worktree

const (
	Unmodified         Status = "Unmodified"
	Untracked          Status = "Untracked"
	Modified           Status = "Modified"
	Added              Status = "Added"
	Deleted            Status = "Deleted"
	Renamed            Status = "Renamed"
	Copied             Status = "Copied"
	UpdatedButUnmerged Status = "Updated but unmerged"
)

type Store

type Store interface {
	List() ([]*Workspace, error)
	Find(idOrName string) (*Workspace, error)
	Save(workspace *Workspace) error
	Delete(workspace *Workspace) error
}

type Workspace

type Workspace struct {
	Id       string            `json:"id"`
	Name     string            `json:"name"`
	Projects []*Project        `json:"projects"`
	Target   string            `json:"target"`
	ApiKey   string            `json:"-"`
	EnvVars  map[string]string `json:"-"`

} // @name Workspace

func (*Workspace) GetProject

func (w *Workspace) GetProject(projectName string) (*Project, error)

type WorkspaceEnvVarParams added in v0.15.0

type WorkspaceEnvVarParams struct {
	ApiUrl    string
	ServerUrl string
	ClientId  string
}

type WorkspaceInfo

type WorkspaceInfo struct {
	Name             string         `json:"name"`
	Projects         []*ProjectInfo `json:"projects"`
	ProviderMetadata string         `json:"providerMetadata,omitempty"`

} // @name WorkspaceInfo

Jump to

Keyboard shortcuts

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