analyze

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package analyze can analyze things.

Index

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
}

func NewAnalyzer added in v0.9.12

func NewAnalyzer(scmClient ScmClient, gitClient GitClient, formatter Formatter, config *models.Config) *Analyzer

func (*Analyzer) AnalyzeLocalRepo added in v0.9.12

func (a *Analyzer) AnalyzeLocalRepo(ctx context.Context, repoPath string) error

func (*Analyzer) AnalyzeOrg added in v0.9.12

func (a *Analyzer) AnalyzeOrg(ctx context.Context, org string, numberOfGoroutines *int) error

func (*Analyzer) AnalyzeRepo added in v0.9.12

func (a *Analyzer) AnalyzeRepo(ctx context.Context, repoString string) error

type Formatter

type Formatter interface {
	Format(ctx context.Context, report *opa.FindingsResult, packages []*models.PackageInsights) error
}

type GitClient added in v0.9.12

type GitClient interface {
	Clone(ctx context.Context, clonePath string, url string, token string, ref 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)
}

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
}

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)
}

Jump to

Keyboard shortcuts

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