Documentation ¶
Index ¶
- Constants
- Variables
- type GitRepo
- func (r *GitRepo) Close(ctx context.Context) error
- func (r *GitRepo) CollectAll(subtaskCtx plugin.SubTaskContext) error
- func (r *GitRepo) CollectBranches(subtaskCtx plugin.SubTaskContext) error
- func (r *GitRepo) CollectCommits(subtaskCtx plugin.SubTaskContext) error
- func (r *GitRepo) CollectDiffLine(subtaskCtx plugin.SubTaskContext) error
- func (r *GitRepo) CollectTags(subtaskCtx plugin.SubTaskContext) error
- func (r *GitRepo) CountBranches(ctx context.Context) (int, error)
- func (r *GitRepo) CountCommits(ctx context.Context) (int, error)
- func (r *GitRepo) CountTags(ctx context.Context) (int, error)
- func (r *GitRepo) SetCleanUp(f func()) error
- type GitRepoCreator
- func (l *GitRepoCreator) CloneGoGitRepoOverHTTP(ctx plugin.SubTaskContext, repoId, url, user, password, proxy string) (RepoCollector, errors.Error)
- func (l *GitRepoCreator) CloneGoGitRepoOverSSH(ctx plugin.SubTaskContext, repoId, url, privateKey, passphrase string) (RepoCollector, errors.Error)
- func (l *GitRepoCreator) CloneOverHTTP(ctx plugin.SubTaskContext, repoId, url, user, password, proxy string) (RepoCollector, errors.Error)
- func (l *GitRepoCreator) CloneOverSSH(ctx plugin.SubTaskContext, repoId, url, privateKey, passphrase string) (RepoCollector, errors.Error)
- func (l *GitRepoCreator) LocalGoGitRepo(repoPath, repoId string) (*GoGitRepo, errors.Error)
- func (l *GitRepoCreator) LocalRepo(repoPath, repoId string) (*GitRepo, errors.Error)
- type GoGitRepo
- func (r *GoGitRepo) Close(ctx context.Context) error
- func (r *GoGitRepo) CollectAll(subtaskCtx plugin.SubTaskContext) error
- func (r *GoGitRepo) CollectBranches(subtaskCtx plugin.SubTaskContext) error
- func (r *GoGitRepo) CollectCommits(subtaskCtx plugin.SubTaskContext) (err error)
- func (r *GoGitRepo) CollectDiffLine(subtaskCtx plugin.SubTaskContext) error
- func (r *GoGitRepo) CollectTags(subtaskCtx plugin.SubTaskContext) error
- func (r *GoGitRepo) CountBranches(ctx context.Context) (int, error)
- func (r *GoGitRepo) CountCommits(ctx context.Context) (int, error)
- func (r *GoGitRepo) CountTags(ctx context.Context) (int, error)
- func (r *GoGitRepo) GetCommitList(subtaskCtx plugin.SubTaskContext) ([]*object.Commit, error)
- func (r *GoGitRepo) SetCleanUp(f func()) error
- type RepoCollector
Constants ¶
const ( BRANCH = "BRANCH" TAG = "TAG" EnableGoGit = true )
const DefaultUser = "git"
const SkipCommitFiles = "SKIP_COMMIT_FILES"
Variables ¶
var TypeNotMatchError = "the requested type does not match the type in the ODB"
Functions ¶
This section is empty.
Types ¶
type GitRepo ¶
type GitRepo struct {
// contains filtered or unexported fields
}
func (*GitRepo) CollectAll ¶
func (r *GitRepo) CollectAll(subtaskCtx plugin.SubTaskContext) error
CollectAll The main parser subtask
func (*GitRepo) CollectBranches ¶
func (r *GitRepo) CollectBranches(subtaskCtx plugin.SubTaskContext) error
CollectBranches Collect branch data
func (*GitRepo) CollectCommits ¶
func (r *GitRepo) CollectCommits(subtaskCtx plugin.SubTaskContext) error
CollectCommits Collect data from each commit, we can also get the diff line
func (*GitRepo) CollectDiffLine ¶
func (r *GitRepo) CollectDiffLine(subtaskCtx plugin.SubTaskContext) error
CollectDiffLine get line diff data from a specific branch
func (*GitRepo) CollectTags ¶
func (r *GitRepo) CollectTags(subtaskCtx plugin.SubTaskContext) error
CollectTags Collect Tags data
func (*GitRepo) CountBranches ¶
CountBranches count the number of branches in a git repo
func (*GitRepo) CountCommits ¶
CountCommits count the number of commits in a git repo
func (*GitRepo) SetCleanUp ¶
type GitRepoCreator ¶
type GitRepoCreator struct {
// contains filtered or unexported fields
}
func NewGitRepoCreator ¶
func NewGitRepoCreator(store models.Store, logger log.Logger) *GitRepoCreator
func (*GitRepoCreator) CloneGoGitRepoOverHTTP ¶
func (l *GitRepoCreator) CloneGoGitRepoOverHTTP(ctx plugin.SubTaskContext, repoId, url, user, password, proxy string) (RepoCollector, errors.Error)
func (*GitRepoCreator) CloneGoGitRepoOverSSH ¶
func (l *GitRepoCreator) CloneGoGitRepoOverSSH(ctx plugin.SubTaskContext, repoId, url, privateKey, passphrase string) (RepoCollector, errors.Error)
func (*GitRepoCreator) CloneOverHTTP ¶
func (l *GitRepoCreator) CloneOverHTTP(ctx plugin.SubTaskContext, repoId, url, user, password, proxy string) (RepoCollector, errors.Error)
func (*GitRepoCreator) CloneOverSSH ¶
func (l *GitRepoCreator) CloneOverSSH(ctx plugin.SubTaskContext, repoId, url, privateKey, passphrase string) (RepoCollector, errors.Error)
func (*GitRepoCreator) LocalGoGitRepo ¶
func (l *GitRepoCreator) LocalGoGitRepo(repoPath, repoId string) (*GoGitRepo, errors.Error)
LocalGoGitRepo open a local repository with go-git
type GoGitRepo ¶
type GoGitRepo struct {
// contains filtered or unexported fields
}
func (*GoGitRepo) CollectAll ¶
func (r *GoGitRepo) CollectAll(subtaskCtx plugin.SubTaskContext) error
CollectAll The main parser subtask
func (*GoGitRepo) CollectBranches ¶
func (r *GoGitRepo) CollectBranches(subtaskCtx plugin.SubTaskContext) error
CollectBranches Collect branch data
func (*GoGitRepo) CollectCommits ¶
func (r *GoGitRepo) CollectCommits(subtaskCtx plugin.SubTaskContext) (err error)
CollectCommits Collect data from each commit, we can also get the diff line
func (*GoGitRepo) CollectDiffLine ¶
func (r *GoGitRepo) CollectDiffLine(subtaskCtx plugin.SubTaskContext) error
func (*GoGitRepo) CollectTags ¶
func (r *GoGitRepo) CollectTags(subtaskCtx plugin.SubTaskContext) error
CollectTags Collect Tags data
func (*GoGitRepo) CountBranches ¶
CountBranches count the number of branches in a git repo
func (*GoGitRepo) CountCommits ¶
CountCommits count the number of commits in a git repo
func (*GoGitRepo) GetCommitList ¶
func (*GoGitRepo) SetCleanUp ¶
type RepoCollector ¶
type RepoCollector interface { SetCleanUp(func()) error Close(ctx context.Context) error CollectAll(subtaskCtx plugin.SubTaskContext) error CountTags(ctx context.Context) (int, error) CountBranches(ctx context.Context) (int, error) CountCommits(ctx context.Context) (int, error) CollectTags(subtaskCtx plugin.SubTaskContext) error CollectBranches(subtaskCtx plugin.SubTaskContext) error CollectCommits(subtaskCtx plugin.SubTaskContext) error CollectDiffLine(subtaskCtx plugin.SubTaskContext) error }