Documentation
¶
Overview ¶
Package analyze can analyze things.
Index ¶
- Constants
- type Analyzer
- func (a *Analyzer) AnalyzeLocalRepo(ctx context.Context, repoPath string) (*models.PackageInsights, error)
- func (a *Analyzer) AnalyzeManifest(ctx context.Context, manifestReader io.Reader, manifestType string) (*models.PackageInsights, error)
- func (a *Analyzer) AnalyzeOrg(ctx context.Context, org string, numberOfGoroutines *int) ([]*models.PackageInsights, error)
- func (a *Analyzer) AnalyzeRepo(ctx context.Context, repoString string, ref string) (*models.PackageInsights, error)
- func (a *Analyzer) AnalyzeStaleBranches(ctx context.Context, repoString string, numberOfGoroutines *int, expand *bool, ...) (*models.PackageInsights, error)
- func (a *Analyzer) FetchConeToTemp(ctx context.Context, gitURL, token, ref string, cone string) (string, error)
- func (a *Analyzer) GeneratePackageInsights(ctx context.Context, tempDir string, repo Repository, ref string) (*models.PackageInsights, error)
- func (a *Analyzer) ProgressBar(maxValue int64, description string) *progressbar.ProgressBar
- type Formatter
- type GitClient
- type RepoBatch
- type Repository
- type ScmClient
Constants ¶
View Source
const TEMP_DIR_PREFIX = "poutine-*"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶ added in v0.9.12
type Analyzer struct {
ScmClient ScmClient
GitClient GitClient
Formatter Formatter
Config *models.Config
Opa *opa.Opa
}
func NewAnalyzer ¶ added in v0.9.12
func (*Analyzer) AnalyzeLocalRepo ¶ added in v0.9.12
func (*Analyzer) AnalyzeManifest ¶ added in v1.0.1
func (*Analyzer) AnalyzeOrg ¶ added in v0.9.12
func (*Analyzer) AnalyzeRepo ¶ added in v0.9.12
func (*Analyzer) AnalyzeStaleBranches ¶ added in v0.17.0
func (*Analyzer) FetchConeToTemp ¶ added in v0.18.0
func (*Analyzer) GeneratePackageInsights ¶ added in v0.18.0
func (a *Analyzer) GeneratePackageInsights(ctx context.Context, tempDir string, repo Repository, ref string) (*models.PackageInsights, error)
func (*Analyzer) ProgressBar ¶ added in v0.18.0
type GitClient ¶ added in v0.9.12
type GitClient interface {
Clone(ctx context.Context, clonePath string, url string, token string, ref string) error
FetchCone(ctx context.Context, clonePath string, url string, token string, ref string, cone string) error
CommitSHA(clonePath string) (string, error)
LastCommitDate(ctx context.Context, clonePath string) (time.Time, error)
GetRemoteOriginURL(ctx context.Context, repoPath string) (string, error)
GetRepoHeadBranchName(ctx context.Context, repoPath string) (string, error)
GetUniqWorkflowsBranches(ctx context.Context, clonePath string) (map[string][]models.BranchInfo, error)
BlobMatches(ctx context.Context, clonePath string, blobsha string, regex *regexp.Regexp) (bool, []byte, error)
}
type RepoBatch ¶
type RepoBatch struct {
TotalCount int
Repositories []Repository
Err error
}
type Repository ¶
type Repository interface {
GetProviderName() string
GetRepoIdentifier() string
GetIsFork() bool
BuildGitURL(baseURL string) string
GetHasIssues() bool
GetHasWiki() bool
GetHasDiscussion() bool
GetOpenIssuesCount() int
GetForksCount() int
GetStarsCount() int
GetPrimaryLanguage() string
GetSize() int
GetDefaultBranch() string
GetLicense() string
GetIsTemplate() bool
GetOrganizationID() int
GetRepositoryID() int
GetIsEmpty() bool
}
type ScmClient ¶
type ScmClient interface {
GetOrgRepos(ctx context.Context, org string) <-chan RepoBatch
GetRepo(ctx context.Context, org string, name string) (Repository, error)
GetToken() string
GetProviderName() string
GetProviderVersion(ctx context.Context) (string, error)
GetProviderBaseURL() string
ParseRepoAndOrg(string) (string, string, error)
}
Click to show internal directories.
Click to hide internal directories.