usecase

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock added in v0.2.0

type Mock struct {
	MockInsertScanResult func(ctx context.Context, meta model.GitHubMetadata, report trivy.Report) error
	MockScanGitHubRepo   func(ctx context.Context, input *model.ScanGitHubRepoInput) error
}

func NewMock added in v0.2.0

func NewMock() *Mock

func (*Mock) InsertScanResult added in v0.3.0

func (x *Mock) InsertScanResult(ctx context.Context, meta model.GitHubMetadata, report trivy.Report) error

func (*Mock) ScanGitHubRepo added in v0.2.0

func (x *Mock) ScanGitHubRepo(ctx context.Context, input *model.ScanGitHubRepoInput) error

ScanGitHubRepo implements interfaces.UseCase.

type Option added in v0.3.0

type Option func(*UseCase)

func WithBigQueryTableID added in v0.3.0

func WithBigQueryTableID(tableID types.BQTableID) Option

type UseCase added in v0.2.0

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

func New

func New(clients *infra.Clients, options ...Option) *UseCase

func (*UseCase) CommentGitHubPR added in v0.3.0

func (x *UseCase) CommentGitHubPR(ctx context.Context, input *model.ScanGitHubRepoInput, report *trivy.Report) error

func (*UseCase) InsertScanResult added in v0.3.0

func (x *UseCase) InsertScanResult(ctx context.Context, meta model.GitHubMetadata, report trivy.Report) error

func (*UseCase) ScanGitHubRepo added in v0.2.0

func (x *UseCase) ScanGitHubRepo(ctx context.Context, input *model.ScanGitHubRepoInput) error

ScanGitHubRepo is a usecase to download a source code from GitHub and scan it with Trivy. Using GitHub App credentials to download a private repository, then the app should be installed to the repository and have read access. After scanning, the result is stored to the database. The temporary files are removed after the scan.

Jump to

Keyboard shortcuts

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