workspace

package
v0.0.0-...-bfc391e Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WorkspaceId   string
	WorkspaceName string
)

Functions

func ArchiveWorkspace

func ArchiveWorkspace(ctx context.Context, workspaceId string) (string, error)

func CreateWorkspace

func CreateWorkspace(ctx context.Context, name string, customKey string) (string, error)

CreateWorkspace creates a new workspace with the given name in the data directory. If the workspace already exists, a directory with a name appended with a number will be created.

func DeleteWorkspace

func DeleteWorkspace(ctx context.Context, workspaceId string) (string, error)

func GetWorkspaceId

func GetWorkspaceId(cmd *cobra.Command) (string, error)

func GetWorkspacePath

func GetWorkspacePath(ctx context.Context, workspaceId string) (string, error)

func ListWorkspaces

func ListWorkspaces(ctx context.Context, all bool, archived bool) (*table.Table, error)

func NewCreateWorkspaceForm

func NewCreateWorkspaceForm(ctx context.Context, workspaceId string, workspaceName string) (*huh.Form, error)

NewCreateWorkspaceForm creates a new form for creating a workspace. The context is used to get the configuration. Which is used to determine if the form should be in accessible mode or not.

func NewSelectWorkspaceForm

func NewSelectWorkspaceForm(ctx context.Context, all bool, archived bool) (*huh.Form, error)

func NewUpdateWorkspaceForm

func NewUpdateWorkspaceForm(ctx context.Context, workspaceId string, workspaceName string) (*huh.Form, error)

NewCreateWorkspaceForm creates a new form for creating a workspace. The context is used to get the configuration. Which is used to determine if the form should be in accessible mode or not.

func NewWorkspaceIdAndNameFormGroup

func NewWorkspaceIdAndNameFormGroup(id, name string) *huh.Group

func UnarchiveWorkspace

func UnarchiveWorkspace(ctx context.Context, workspaceId string) (string, error)

func UpdateWorkspace

func UpdateWorkspace(ctx context.Context, workspaceId string, newWorkspaceId string, newWorkspaceName string) error

Types

type WorkspaceConfig

type WorkspaceConfig struct {
	Id       string
	Name     string
	Archived bool
}

WorkspaceConfig holds the configuration for a workspace.

func GetWorkspaceConfig

func GetWorkspaceConfig(ctx context.Context, workspaceId string) (*WorkspaceConfig, error)

Jump to

Keyboard shortcuts

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