Documentation ¶
Index ¶
- func ExtractOwnerAndRepoName(url string) (owner string, repoName *string, err error)
- func GetRootPathOfLocalGitRepo(startPath string) (rootPath string, found bool, err error)
- func ListRemoteReferences(repo *git.Repository) ([]*plumbing.Reference, error)
- func OpenRepoInLocalPath(path string) (*git.Repository, error)
- func ProcessAllCommits[T SearchResult](path string, repo *git.Repository, searcher Searcher[T], mode Mode) ([]RepoResult[T], Stats, error)
- func ProcessAllFiles[T SearchResult](searcher Searcher[T], repo Repository) ([]RepoResult[T], Stats, error)
- type BranchResult
- type GitHubClient
- func (gc *GitHubClient) CloneOrFetchRepo(url string, progressWriter *io.Writer, opts *GitHubOptions) (*GitHubResult, error)
- func (gc *GitHubClient) CloneRepo(url string, progressWriter *io.Writer, opts *GitHubOptions) (*GitHubResult, error)
- func (gc *GitHubClient) FetchRepo(url string, progressWriter *io.Writer, opts *GitHubOptions) (*GitHubResult, error)
- func (gc *GitHubClient) GetGitHubOrganization(org string) (info *github.Organization, found bool, err error)
- func (gc *GitHubClient) GetGitHubRepo(owner string, repoName string) (info *github.Repository, found bool, err error)
- func (gc *GitHubClient) GetGitHubUser(user string) (info *github.User, found bool, err error)
- func (gc *GitHubClient) GetRepositories(url string) ([]string, error)
- func (gc *GitHubClient) ListAllReposForOrg(org string) ([]*github.Repository, error)
- func (gc *GitHubClient) ListAllReposForUser(user string) ([]*github.Repository, error)
- type GitHubOptions
- type GitHubResult
- type Mode
- type ProcessedState
- type RepoResult
- type RepoState
- type Repository
- type SearchResult
- type Searcher
- type Stats
- type TreePath
- type TreeSearchResult
- type WorkerResult
- type WorkerStats
- func (ws *WorkerStats) DataLoadTime() int64
- func (ws *WorkerStats) ListFilesTime() int64
- func (ws *WorkerStats) NumberOfBranches() uint64
- func (ws *WorkerStats) NumberOfFiles() uint64
- func (ws *WorkerStats) NumberOfRepos() int
- func (ws *WorkerStats) QueryTime() int64
- func (ws *WorkerStats) TotalFileSize() uint64
- type WrappedSearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractOwnerAndRepoName ¶
func ListRemoteReferences ¶
func OpenRepoInLocalPath ¶
func ProcessAllCommits ¶
func ProcessAllCommits[T SearchResult](path string, repo *git.Repository, searcher Searcher[T], mode Mode) ([]RepoResult[T], Stats, error)
func ProcessAllFiles ¶
func ProcessAllFiles[T SearchResult](searcher Searcher[T], repo Repository) ([]RepoResult[T], Stats, error)
Types ¶
type BranchResult ¶
type BranchResult struct {
// contains filtered or unexported fields
}
func (*BranchResult) FirstCommit ¶
func (br *BranchResult) FirstCommit() []*object.Commit
func (*BranchResult) LastCommit ¶
func (br *BranchResult) LastCommit() *object.Commit
func (*BranchResult) Name ¶
func (br *BranchResult) Name() string
func (*BranchResult) OnTip ¶
func (br *BranchResult) OnTip() bool
type GitHubClient ¶
type GitHubClient struct {
// contains filtered or unexported fields
}
func NewAuthenticatedGitHubClient ¶
func NewAuthenticatedGitHubClient(token string) *GitHubClient
func NewGitHubClient ¶
func NewGitHubClient() *GitHubClient
func (*GitHubClient) CloneOrFetchRepo ¶
func (gc *GitHubClient) CloneOrFetchRepo(url string, progressWriter *io.Writer, opts *GitHubOptions) (*GitHubResult, error)
func (*GitHubClient) CloneRepo ¶
func (gc *GitHubClient) CloneRepo(url string, progressWriter *io.Writer, opts *GitHubOptions) (*GitHubResult, error)
func (*GitHubClient) FetchRepo ¶
func (gc *GitHubClient) FetchRepo(url string, progressWriter *io.Writer, opts *GitHubOptions) (*GitHubResult, error)
func (*GitHubClient) GetGitHubOrganization ¶
func (gc *GitHubClient) GetGitHubOrganization(org string) (info *github.Organization, found bool, err error)
func (*GitHubClient) GetGitHubRepo ¶
func (gc *GitHubClient) GetGitHubRepo(owner string, repoName string) (info *github.Repository, found bool, err error)
func (*GitHubClient) GetGitHubUser ¶
func (*GitHubClient) GetRepositories ¶
func (gc *GitHubClient) GetRepositories(url string) ([]string, error)
func (*GitHubClient) ListAllReposForOrg ¶
func (gc *GitHubClient) ListAllReposForOrg(org string) ([]*github.Repository, error)
func (*GitHubClient) ListAllReposForUser ¶
func (gc *GitHubClient) ListAllReposForUser(user string) ([]*github.Repository, error)
type GitHubOptions ¶
type GitHubResult ¶
type ProcessedState ¶
type ProcessedState[T SearchResult] struct { // contains filtered or unexported fields }
func NewProcessedState ¶
func NewProcessedState[T SearchResult]() *ProcessedState[T]
type RepoResult ¶
type RepoResult[T SearchResult] struct { Path string Results []T Matches map[T][]BranchResult DanglingCommits map[T]*object.Commit Tags map[T][]*object.Tag }
type RepoState ¶
type RepoState struct { BlobMap map[plumbing.Hash]*object.Blob TreeMap map[plumbing.Hash]*object.Tree CommitMap map[plumbing.Hash]*object.Commit TagMap map[plumbing.Hash]*object.Tag TargetToTagMap map[plumbing.Hash][]*object.Tag }
func LoadRepoState ¶
func LoadRepoState(repo *git.Repository) *RepoState
type Repository ¶
type Repository interface { OrganizationName() string RepositoryName() string LocalRootPath() string SubPath() *string }
func GetAllReposForAllOrgs ¶
func GetAllReposForAllOrgs(orgsDir string) ([]Repository, error)
func InferReposFromPath ¶
func InferReposFromPath(path string) ([]Repository, error)
type SearchResult ¶
type SearchResult interface { comparable MatchId() string SearchTermId() string }
type Searcher ¶
type Searcher[T SearchResult] interface { Process(hash *plumbing.Hash, loadData func() []byte, path string) []T }
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func (*Stats) DataLoadTime ¶
func (*Stats) ListFilesTime ¶
func (*Stats) NumberOfBranches ¶
type TreeSearchResult ¶
type TreeSearchResult[T SearchResult] struct { SearchResult T Path string }
type WorkerResult ¶
type WorkerResult[T SearchResult] struct { Repo Repository Ref string RepoResults []RepoResult[T] }
type WorkerStats ¶
type WorkerStats struct {
// contains filtered or unexported fields
}
func Search ¶
func Search[T SearchResult](repos []Repository, newSearcher func(Repository) Searcher[T], mode Mode, concurrency int) (chan WorkerResult[T], *WorkerStats)
func (*WorkerStats) DataLoadTime ¶
func (ws *WorkerStats) DataLoadTime() int64
func (*WorkerStats) ListFilesTime ¶
func (ws *WorkerStats) ListFilesTime() int64
func (*WorkerStats) NumberOfBranches ¶
func (ws *WorkerStats) NumberOfBranches() uint64
func (*WorkerStats) NumberOfFiles ¶
func (ws *WorkerStats) NumberOfFiles() uint64
func (*WorkerStats) NumberOfRepos ¶
func (ws *WorkerStats) NumberOfRepos() int
func (*WorkerStats) QueryTime ¶
func (ws *WorkerStats) QueryTime() int64
func (*WorkerStats) TotalFileSize ¶
func (ws *WorkerStats) TotalFileSize() uint64
type WrappedSearchResult ¶
type WrappedSearchResult[T SearchResult] struct { SearchResult *TreeSearchResult[T] // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.