workspaces

package
v0.0.0-...-9be9164 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWorkspace

func CreateWorkspace(ctx context.Context, name string, folders []string) error

CreateWorkspace creates a workspace YAML file with the given name, and adds all the git repositories found in the specified folders to it.

func DeleteWorkspace

func DeleteWorkspace(name string) error

DeleteWorkspace deletes the workspace with the given name.

func GetWorkspacePath

func GetWorkspacePath(name string) string

func ImportToWorkspace

func ImportToWorkspace(ctx context.Context, name string, filePath string, dir string) error

ImportToWorkspace imports a set of repositories, given a file with list of repositories to a workspace

func Save

func Save(name string, workspaceConfig Config) error

func UpsertWorkspace

func UpsertWorkspace(ctx context.Context, name string, folders []string) error

UpsertWorkspace adds the given repositories to the workspace, or creates a new workspace if it doesn't exist.

Types

type Config

type Config interface {
	GetRepositories() []Repo
	AddRepositories(repos []Repo)
}

func NewConfig

func NewConfig(repos []Repo) Config

NewConfig creates a new workspace configuration.

type Repo

type Repo struct {
	Name     string `yaml:"name"`
	Path     string `yaml:"path"`
	RepoType string `yaml:"type"`
	Remote   string `yaml:"remote"`
}

Repo represents a git repository with its absolute path and remote URL.

func LoadGitRepoDataFromFolders

func LoadGitRepoDataFromFolders(ctx context.Context, folders []string) ([]Repo, error)

func (*Repo) GetGitApiWrapper

func (r *Repo) GetGitApiWrapper() (gitapi.Wrapper, error)

GetGitApiWrapper returns a GitApiWrapper for the repository.

type Workspace

type Workspace interface {
	// GetRepoFolders returns the absolute paths of all repositories in the workspace.
	GetRepoFolders(repoType string) []string
	GetName() string
	GetFilePath() string
	GetConfig() Config
}

func LoadWorkspace

func LoadWorkspace(name string) (Workspace, error)

func NewWorkspace

func NewWorkspace(name, path string, config Config) Workspace

Jump to

Keyboard shortcuts

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