workspace

package
v0.0.0-...-67698d1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package workspace let's you manage workspaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composer

type Composer struct {
	// contains filtered or unexported fields
}

func NewComposer

func NewComposer(bm bind.PathBinder) Composer

func (Composer) Compose

func (m Composer) Compose(codebasePath string, workspacePath string) ([]string, error)

Compose a workspace from a codebase Returns a list of path binds in the order they were bound

func (Composer) Dismantle

func (m Composer) Dismantle(dismantlePath string) ([]string, error)

Dismantle a workspace Returns a list of path unbinds in the order they were unbound

func (Composer) List

func (m Composer) List(listPath string) ([]string, error)

List all binds attached under a directory

func (Composer) Unbind

func (m Composer) Unbind(unbindPath string) error

Unbind a project

type FileCopier

type FileCopier struct {
}

func NewFileCopier

func NewFileCopier() *FileCopier

func (FileCopier) Copy

func (f FileCopier) Copy(codebaseDir string, gitProjects []string, workspaceDir string) error

gitProjects is relative to codebaseDir

func (FileCopier) CopyDirOnly

func (f FileCopier) CopyDirOnly(sourceInfo os.FileInfo, destPath string) error

CopyDirOnly copies a directory non-recursively sourcePath must be contained in codebaseDir

func (FileCopier) CopyDirRecursive

func (f FileCopier) CopyDirRecursive(sourceInfo os.FileInfo, sourcePath, destPath string) error

func (FileCopier) CopyFile

func (f FileCopier) CopyFile(sourceInfo os.FileInfo, sourcePath, destPath string) error

CopyFile copies a single file sourcePath must be contained in codebaseDir

func (FileCopier) CopyNode

func (f FileCopier) CopyNode(sourceInfo os.FileInfo, codebaseDir, sourcePath, workspaceDir string) error

Copy any single file, symlink or dir non-recursively sourcePath must be contained in codebaseDir

func (f FileCopier) CopySymlink(sourcePath string, destPath string) error

func (FileCopier) GetContainsGitProjectFunc

func (f FileCopier) GetContainsGitProjectFunc(codebaseDir string, gitProjects []string) func(string) (bool, error)

func (FileCopier) GetDestPath

func (f FileCopier) GetDestPath(codebaseDir, sourcePath, workspaceDir string) (string, error)

func (FileCopier) GetIsGitProjectFunc

func (f FileCopier) GetIsGitProjectFunc(codebaseDir string, gitProjects []string) func(string) (bool, error)

type Workspace

type Workspace struct {
	// contains filtered or unexported fields
}

func New

func New(bm bind.PathBinder, topDir string) Workspace

func (Workspace) Create

func (w Workspace) Create(workspaceName string, codebaseName string) (string, error)

Create workspace

func (Workspace) DetachGitWorktrees

func (w Workspace) DetachGitWorktrees(workspaceName string, unbindList []string) error

func (Workspace) Edit

func (w Workspace) Edit(editPath string) (string, string, error)

func (Workspace) GetCodebase

func (w Workspace) GetCodebase(workspaceName string) (string, error)

GetCodebase retrieves the codebase that a workspace belongs to

func (Workspace) GetDir

func (w Workspace) GetDir(workspaceName string) (string, error)

GetDir retrieves the directory of a specific workspace

func (Workspace) List

func (w Workspace) List() map[string]string

func (Workspace) Recreate

func (w Workspace) Recreate(workspaceName string) (string, error)

Recreate workspace

func (Workspace) Remove

func (w Workspace) Remove(remove string) (*config.Config, error)

func (*Workspace) SetTopDir

func (w *Workspace) SetTopDir(dir string)

SetTopDir sets the directory that contains all workspaces

Jump to

Keyboard shortcuts

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