parser

package
v0.0.0-...-1fa52ee Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0, BSD-2-Clause, ISC, + 1 more Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BRANCH      = "BRANCH"
	TAG         = "TAG"
	EnableGoGit = true
)
View Source
const DefaultUser = "git"
View Source
const SkipCommitFiles = "SKIP_COMMIT_FILES"

Variables

View Source
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) Close

func (r *GitRepo) Close(ctx context.Context) error

Close resources

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

func (r *GitRepo) CountBranches(ctx context.Context) (int, error)

CountBranches count the number of branches in a git repo

func (*GitRepo) CountCommits

func (r *GitRepo) CountCommits(ctx context.Context) (int, error)

CountCommits count the number of commits in a git repo

func (*GitRepo) CountTags

func (r *GitRepo) CountTags(ctx context.Context) (int, error)

CountTags Count git tags subtask

func (*GitRepo) SetCleanUp

func (r *GitRepo) SetCleanUp(f func()) error

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

func (*GitRepoCreator) LocalRepo

func (l *GitRepoCreator) LocalRepo(repoPath, repoId string) (*GitRepo, errors.Error)

LocalRepo open a local repository

type GoGitRepo

type GoGitRepo struct {
	// contains filtered or unexported fields
}

func (*GoGitRepo) Close

func (r *GoGitRepo) Close(ctx context.Context) error

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

func (r *GoGitRepo) CountBranches(ctx context.Context) (int, error)

CountBranches count the number of branches in a git repo

func (*GoGitRepo) CountCommits

func (r *GoGitRepo) CountCommits(ctx context.Context) (int, error)

CountCommits count the number of commits in a git repo

func (*GoGitRepo) CountTags

func (r *GoGitRepo) CountTags(ctx context.Context) (int, error)

CountTags Count git tags subtask

func (*GoGitRepo) GetCommitList

func (r *GoGitRepo) GetCommitList(subtaskCtx plugin.SubTaskContext) ([]*object.Commit, error)

func (*GoGitRepo) SetCleanUp

func (r *GoGitRepo) SetCleanUp(f func()) error

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
}

Jump to

Keyboard shortcuts

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