manager

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit struct {
	ID      uid.UID
	Date    *time.Time
	Message string
}

Commit 提交信息

func GetCommitFromNode

func GetCommitFromNode(node trees.Node) Commit

GetCommitFromNode 从节点获取提交信息

func (*Commit) SetToNode

func (commit *Commit) SetToNode(node trees.Node)

SetToNode 设置提交信息到节点

type Manager

type Manager interface {
	// Prepare 准备
	Prepare(ctx context.Context) error
	// CreateWorkspace 创建工作空间
	CreateWorkspace(ctx context.Context, path string) (workspaces.Workspace, error)
	// GetWorkspaceFromPath 从指定目录获取对应工作空间
	GetWorkspaceFromPath(ctx context.Context, path string) (workspaces.Workspace, error)
	// RemoveWorkspaceMount 删除工作空间挂载
	RemoveWorkspaceMount(ctx context.Context, ws workspaces.Workspace) error
	// Clone 克隆工作空间
	Clone(ctx context.Context, ws workspaces.Workspace, targetPath string) (workspaces.Workspace, error)
	// Commit 提交工作空间变更
	Commit(ctx context.Context, ws workspaces.Workspace, info Commit) (workspaces.Workspace, error)
	// Checkout 切换工作空间所处树的位置
	Checkout(ctx context.Context, ws workspaces.Workspace, revision string) (workspaces.Workspace, error)
	// GetHistory 获取提交历史
	GetHistory(ctx context.Context, ws workspaces.Workspace, revision string) ([]Commit, error)
}

Manager 管理器

func New

func New(opts Options) (Manager, error)

New 创建一个 Manager

type Options

type Options struct {
	// 数据存储根目录
	DataRoot string
	// 修改空间中存储文件所属用户 ID , -1 表示不修改
	ChownUID int
	// 修改空间中存储文件所属用户组 ID , -1 表示不修改
	ChownGID int
}

Options 管理器选项

type WorkspaceInfo

type WorkspaceInfo struct {
	Path    string `json:"path"`
	Head    string `json:"head"`
	SpaceID string `json:"sapceID"`
	MountID string `json:"mountID"`
}

WorkspaceInfo 工作空间信息

Jump to

Keyboard shortcuts

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