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) 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)
- 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) AnalyzeOrg ¶ added in v0.9.12
func (*Analyzer) AnalyzeRepo ¶ added in v0.9.12
type Formatter ¶
type Formatter interface { Format(ctx context.Context, packages []*models.PackageInsights) error FormatWithPath(ctx context.Context, packages []*models.PackageInsights, pathAssociation map[string][]models.BranchInfo) error }
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.