Documentation
¶
Index ¶
- Constants
- func GetGitRepoCacheDir() string
- func GetWorkTreeCacheDir() string
- func HasSubmodulesInCommit(commit *object.Commit) (bool, error)
- func Init() error
- func ReadCommitFileAndCompareWithProjectFile(ctx context.Context, localGitRepo *Local, commit, projectDir, relPath string) ([]byte, error)
- func ReadIndexFileAndCompareWithProjectFile(ctx context.Context, localGitRepo *Local, projectDir, relPath string) ([]byte, error)
- type Archive
- type ArchiveFile
- type ArchiveOptions
- type ArchiveType
- type Base
- func (repo *Base) GetName() string
- func (repo *Base) HeadCommit(ctx context.Context) (string, error)
- func (repo *Base) LatestBranchCommit(ctx context.Context, branch string) (string, error)
- func (repo *Base) String() string
- func (repo *Base) TagCommit(ctx context.Context, branch string) (string, error)
- type Checksum
- type ChecksumDescriptor
- type ChecksumOptions
- type FilterOptions
- type GitDataManager
- func (manager *GitDataManager) CreateArchiveFile(ctx context.Context, repoID string, opts ArchiveOptions, tmpPath string, ...) (*ArchiveFile, error)
- func (manager *GitDataManager) CreatePatchFile(ctx context.Context, repoID string, opts PatchOptions, tmpPath string, ...) (*PatchFile, error)
- func (manager *GitDataManager) GC() error
- func (manager *GitDataManager) GetArchiveFile(ctx context.Context, repoID string, opts ArchiveOptions) (*ArchiveFile, error)
- func (manager *GitDataManager) GetPatchFile(ctx context.Context, repoID string, opts PatchOptions) (*PatchFile, error)
- func (manager *GitDataManager) NewTmpFile() (string, error)
- type GitRepo
- type Local
- func (repo *Local) CheckAndReadCommitSymlink(ctx context.Context, path string, commit string) (bool, []byte, error)
- func (repo *Local) CheckIgnore(ctx context.Context, paths []string) (*check_ignore.Result, error)
- func (repo *Local) Checksum(ctx context.Context, opts ChecksumOptions) (checksum Checksum, err error)
- func (repo *Local) CreateArchive(ctx context.Context, opts ArchiveOptions) (Archive, error)
- func (repo *Local) CreateDetachedMergeCommit(ctx context.Context, fromCommit, toCommit string) (string, error)
- func (repo *Local) CreatePatch(ctx context.Context, opts PatchOptions) (Patch, error)
- func (repo *Local) FetchOrigin(ctx context.Context) error
- func (repo *Local) GetCommitFilePathList(ctx context.Context, commit string) ([]string, error)
- func (repo *Local) GetIndexFilePathList(_ context.Context) ([]string, error)
- func (repo *Local) GetMergeCommitParents(_ context.Context, commit string) ([]string, error)
- func (repo *Local) HeadCommit(ctx context.Context) (string, error)
- func (repo *Local) IsAncestor(_ context.Context, ancestorCommit, descendantCommit string) (bool, error)
- func (repo *Local) IsCommitDirectoryExists(ctx context.Context, dir string, commit string) (bool, error)
- func (repo *Local) IsCommitExists(ctx context.Context, commit string) (bool, error)
- func (repo *Local) IsCommitFileExists(ctx context.Context, commit, path string) (bool, error)
- func (repo *Local) IsEmpty(ctx context.Context) (bool, error)
- func (repo *Local) IsHeadReferenceExist(ctx context.Context) (bool, error)
- func (repo *Local) IsIndexFileExists(_ context.Context, path string) (bool, error)
- func (repo *Local) IsShallowClone() (bool, error)
- func (repo *Local) LsTree(ctx context.Context, pathMatcher path_matcher.PathMatcher, opts LsTreeOptions) (*ls_tree.Result, error)
- func (repo *Local) PlainOpen() (*git.Repository, error)
- func (repo *Local) ReadCommitFile(ctx context.Context, commit, path string) ([]byte, error)
- func (repo *Local) ReadIndexFile(_ context.Context, path string) ([]byte, error)
- func (repo *Local) RemoteBranchesList(ctx context.Context) ([]string, error)
- func (repo *Local) RemoteOriginUrl(ctx context.Context) (string, error)
- func (repo *Local) Status(ctx context.Context, pathMatcher path_matcher.PathMatcher) (*status.Result, error)
- func (repo *Local) SyncWithOrigin(ctx context.Context) error
- func (repo *Local) TagsList(ctx context.Context) ([]string, error)
- type LsTreeOptions
- type Patch
- type PatchFile
- type PatchOptions
- type Remote
- func (repo *Remote) Checksum(ctx context.Context, opts ChecksumOptions) (checksum Checksum, err error)
- func (repo *Remote) Clone(ctx context.Context) (bool, error)
- func (repo *Remote) CloneAndFetch(ctx context.Context) error
- func (repo *Remote) CreateArchive(ctx context.Context, opts ArchiveOptions) (Archive, error)
- func (repo *Remote) CreateDetachedMergeCommit(ctx context.Context, fromCommit, toCommit string) (string, error)
- func (repo *Remote) CreatePatch(ctx context.Context, opts PatchOptions) (Patch, error)
- func (repo *Remote) Fetch(ctx context.Context) error
- func (repo *Remote) GetClonePath() string
- func (repo *Remote) GetMergeCommitParents(_ context.Context, commit string) ([]string, error)
- func (repo *Remote) HeadCommit(_ context.Context) (string, error)
- func (repo *Remote) IsAncestor(ctx context.Context, ancestorCommit, descendantCommit string) (bool, error)
- func (repo *Remote) IsCommitExists(ctx context.Context, commit string) (bool, error)
- func (repo *Remote) IsEmpty(ctx context.Context) (bool, error)
- func (repo *Remote) LatestBranchCommit(ctx context.Context, branch string) (string, error)
- func (repo *Remote) RemoteBranchesList(_ context.Context) ([]string, error)
- func (repo *Remote) RemoteOriginUrl() (string, error)
- func (repo *Remote) TagCommit(ctx context.Context, tag string) (string, error)
- func (repo *Remote) TagsList(_ context.Context) ([]string, error)
- func (repo *Remote) ValidateEndpoint() error
Constants ¶
View Source
const ( GitArchivesCacheVersion = "1" GitPatchesCacheVersion = "1" )
View Source
const GitRepoCacheVersion = "3"
View Source
const GitWorkTreeCacheVersion = "6"
Variables ¶
This section is empty.
Functions ¶
func GetGitRepoCacheDir ¶
func GetGitRepoCacheDir() string
func GetWorkTreeCacheDir ¶
func GetWorkTreeCacheDir() string
func ReadCommitFileAndCompareWithProjectFile ¶ added in v1.2.2
Types ¶
type Archive ¶
type Archive interface {
GetFilePath() string
GetType() ArchiveType
IsEmpty() bool
}
type ArchiveFile ¶
type ArchiveFile struct {
FilePath string
Descriptor *true_git.ArchiveDescriptor
}
func (*ArchiveFile) GetFilePath ¶
func (a *ArchiveFile) GetFilePath() string
func (*ArchiveFile) GetType ¶
func (a *ArchiveFile) GetType() ArchiveType
func (*ArchiveFile) IsEmpty ¶
func (a *ArchiveFile) IsEmpty() bool
type ArchiveOptions ¶
type ArchiveOptions struct {
FilterOptions
Commit string
}
type ArchiveType ¶
type ArchiveType string
const ( FileArchive ArchiveType = "file" DirectoryArchive ArchiveType = "directory" )
type Base ¶
func (*Base) LatestBranchCommit ¶
type ChecksumDescriptor ¶
func (*ChecksumDescriptor) GetNoMatchPaths ¶
func (c *ChecksumDescriptor) GetNoMatchPaths() []string
func (*ChecksumDescriptor) String ¶
func (c *ChecksumDescriptor) String() string
type ChecksumOptions ¶
type ChecksumOptions struct {
FilterOptions
Paths []string
Commit string
}
type FilterOptions ¶
type GitDataManager ¶ added in v1.2.2
var (
CommonGitDataManager *GitDataManager
)
func NewGitDataManager ¶ added in v1.2.2
func NewGitDataManager(archivesCacheDir, patchesCacheDir, tmpDir string) *GitDataManager
func (*GitDataManager) CreateArchiveFile ¶ added in v1.2.2
func (manager *GitDataManager) CreateArchiveFile(ctx context.Context, repoID string, opts ArchiveOptions, tmpPath string, desc *true_git.ArchiveDescriptor) (*ArchiveFile, error)
func (*GitDataManager) CreatePatchFile ¶ added in v1.2.2
func (manager *GitDataManager) CreatePatchFile(ctx context.Context, repoID string, opts PatchOptions, tmpPath string, desc *true_git.PatchDescriptor) (*PatchFile, error)
func (*GitDataManager) GC ¶ added in v1.2.2
func (manager *GitDataManager) GC() error
func (*GitDataManager) GetArchiveFile ¶ added in v1.2.2
func (manager *GitDataManager) GetArchiveFile(ctx context.Context, repoID string, opts ArchiveOptions) (*ArchiveFile, error)
func (*GitDataManager) GetPatchFile ¶ added in v1.2.2
func (manager *GitDataManager) GetPatchFile(ctx context.Context, repoID string, opts PatchOptions) (*PatchFile, error)
func (*GitDataManager) NewTmpFile ¶ added in v1.2.2
func (manager *GitDataManager) NewTmpFile() (string, error)
type GitRepo ¶
type GitRepo interface {
String() string
GetName() string
IsEmpty(ctx context.Context) (bool, error)
HeadCommit(ctx context.Context) (string, error)
LatestBranchCommit(ctx context.Context, branch string) (string, error)
TagCommit(ctx context.Context, tag string) (string, error)
IsCommitExists(ctx context.Context, commit string) (bool, error)
IsAncestor(ctx context.Context, ancestorCommit, descendantCommit string) (bool, error)
GetMergeCommitParents(ctx context.Context, commit string) ([]string, error)
CreateDetachedMergeCommit(ctx context.Context, fromCommit, toCommit string) (string, error)
CreatePatch(context.Context, PatchOptions) (Patch, error)
CreateArchive(context.Context, ArchiveOptions) (Archive, error)
Checksum(context.Context, ChecksumOptions) (Checksum, error)
}
type Local ¶
func OpenLocalRepo ¶
func (*Local) CheckAndReadCommitSymlink ¶ added in v1.2.2
func (*Local) CheckIgnore ¶
func (*Local) CreateArchive ¶
func (*Local) CreateDetachedMergeCommit ¶
func (*Local) CreatePatch ¶
func (*Local) FetchOrigin ¶ added in v1.1.23
func (*Local) GetCommitFilePathList ¶ added in v1.2.2
func (*Local) GetIndexFilePathList ¶ added in v1.2.2
TODO submodules are not supported
func (*Local) GetMergeCommitParents ¶
func (*Local) IsAncestor ¶
func (*Local) IsCommitDirectoryExists ¶ added in v1.2.2
func (*Local) IsCommitExists ¶
func (*Local) IsCommitFileExists ¶ added in v1.2.2
func (*Local) IsHeadReferenceExist ¶
func (*Local) IsIndexFileExists ¶ added in v1.2.2
func (*Local) IsShallowClone ¶
func (*Local) LsTree ¶
func (repo *Local) LsTree(ctx context.Context, pathMatcher path_matcher.PathMatcher, opts LsTreeOptions) (*ls_tree.Result, error)
func (*Local) ReadCommitFile ¶ added in v1.2.2
func (*Local) ReadIndexFile ¶ added in v1.2.2
func (*Local) RemoteBranchesList ¶
func (*Local) RemoteOriginUrl ¶
func (*Local) Status ¶
func (repo *Local) Status(ctx context.Context, pathMatcher path_matcher.PathMatcher) (*status.Result, error)
func (*Local) SyncWithOrigin ¶ added in v1.1.23
type LsTreeOptions ¶
type PatchFile ¶
type PatchFile struct {
FilePath string
Descriptor *true_git.PatchDescriptor
}
func (*PatchFile) GetBinaryPaths ¶
func (*PatchFile) GetFilePath ¶
type PatchOptions ¶
type PatchOptions struct {
FilterOptions
FromCommit, ToCommit string
WithEntireFileContext bool
WithBinary bool
}
type Remote ¶
func OpenRemoteRepo ¶
func (*Remote) CreateArchive ¶
func (*Remote) CreateDetachedMergeCommit ¶
func (*Remote) CreatePatch ¶
func (*Remote) GetClonePath ¶
func (*Remote) GetMergeCommitParents ¶
func (*Remote) IsAncestor ¶
func (*Remote) IsCommitExists ¶
func (*Remote) LatestBranchCommit ¶
func (*Remote) RemoteBranchesList ¶
func (*Remote) RemoteOriginUrl ¶
func (*Remote) ValidateEndpoint ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.