repository

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core interface {
	util.LocalDirectory

	Config() GitConfig
	HEAD() GitHEAD
	Hooks() GitHooks
	Index() GitIndex
	Logs() GitLogs
	Modules() GitModules
	Objects() GitObjects
	Refs() GitRefs
	Worktrees() GitWorktrees
}

Core 是仓库的核心目录 ref to the [.git] directory, or not if bare.

type Driver

type Driver interface {
	Factory() Factory
	Locator() Locator
	Accept(uri lang.URI) bool
}

Driver 是仓库驱动

type Factory

type Factory interface {

	// Open 打开位于 location 的仓库
	Open(location *Location) (Viewport, error)
}

Factory 是仓库的工厂

type Finder

type Finder interface {
	Find(path fs.Path) []fs.Path
}

Finder 是仓库的搜索器

type GitConfig

type GitConfig interface {
	util.LocalFile
}

type GitHEAD

type GitHEAD interface {
	util.LocalFile
}

type GitHooks

type GitHooks interface {
	util.LocalDirectory
}

type GitIndex

type GitIndex interface {
	util.LocalFile
}

type GitInfo

type GitInfo interface {
	util.LocalDirectory
}

type GitLogs

type GitLogs interface {
	util.LocalDirectory
}

type GitModules

type GitModules interface {
	util.LocalDirectory

	ListNames() []string
	GetSubmodule(name string) (GitSubmodule, error)
	CreateSubmodule(name string) (GitSubmodule, error)
}

GitModules 表示git的模块集合

type GitObjects

type GitObjects interface {
	util.LocalDirectory

	Info() ObjectsInfo
	Pack() ObjectsPack
}

type GitPWD

type GitPWD interface {
	util.LocalDirectory
}

GitPWD 表示一个viewport的当前工作目录

type GitRefs

type GitRefs interface {
	util.LocalDirectory
}

type GitSubmodule

type GitSubmodule interface {
	util.LocalDirectory

	OpenViewport() (Viewport, error)
}

GitSubmodule 表示一个git子模块

type GitWorkspace

type GitWorkspace interface {
	util.LocalDirectory
}

GitWorkspace aka WorkingDirectory

type GitWorktree

type GitWorktree interface {
	util.LocalDirectory

	GetWorkspace() (GitWorkspace, error)
	OpenViewport() (Viewport, error)
}

GitWorktree 是git工作树

type GitWorktrees

type GitWorktrees interface {
	util.LocalDirectory

	ListNames() []string
	GetWorktree(name string) (GitWorktree, error)
	CreateWorktree(name string) (GitWorktree, error)
	Default() GitWorktree
}

GitWorktrees 是git工作树的集合

type Location

type Location struct {
	PWD    fs.Path
	DotGit fs.Path

	WorkingDirectory   fs.Path
	SubmoduleDirectory fs.Path
	WorktreeDirectory  fs.Path

	CoreDirectory fs.Path
}

Location 表示一个仓库视图的位置

type Locator

type Locator interface {
	Locate(uri lang.URI) (*Location, error)
	Accept(uri lang.URI) bool
}

Locator 是仓库的定位器

type Manager

type Manager interface {
	GetAllDrivers() []Driver
	FindDriver(uri lang.URI) (Driver, error)
	Open(uri lang.URI) (Viewport, error)
}

Manager 是仓库管理器

type ObjectsInfo

type ObjectsInfo interface {
	util.LocalDirectory
}

type ObjectsPack

type ObjectsPack interface {
	util.LocalDirectory
}

type Viewport

type Viewport interface {
	io.Closer

	GetWorkspace() (GitWorkspace, error)
	GetSubmodule() (GitSubmodule, error)
	GetWorktree() (GitWorktree, error)
	GetCore() Core
	GetPWD() GitPWD

	Objects() GitObjects
	Refs() GitRefs
	Config() GitConfig
	Index() GitIndex
	HEAD() GitHEAD
}

Viewport 仓库的一个视图

Jump to

Keyboard shortcuts

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