interfaces

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigQuery

type BigQuery interface {
	Insert(ctx context.Context, tableID types.BQTableID, schema bigquery.Schema, data any) error

	GetMetadata(ctx context.Context, table types.BQTableID) (*bigquery.TableMetadata, error)
	UpdateTable(ctx context.Context, table types.BQTableID, md bigquery.TableMetadataToUpdate, eTag string) error
	CreateTable(ctx context.Context, table types.BQTableID, md *bigquery.TableMetadata) error
}

type GetArchiveURLInput

type GetArchiveURLInput struct {
	Owner     string
	Repo      string
	CommitID  string
	InstallID types.GitHubAppInstallID
}

type GitHub

type GitHub interface {
	GetArchiveURL(ctx context.Context, input *GetArchiveURLInput) (*url.URL, error)
	CreateIssueComment(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, prID int, body string) error
	ListIssueComments(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, prID int) ([]*model.GitHubIssueComment, error)
	MinimizeComment(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, subjectID string) error
	CreateCheckRun(ctx context.Context, id types.GitHubAppInstallID, repo *model.GitHubRepo, commit string) (int64, error)
	UpdateCheckRun(ctx context.Context, id types.GitHubAppInstallID, repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error
}

type GitHubMock

type GitHubMock struct {
	MockGetArchiveURL      func(ctx context.Context, input *GetArchiveURLInput) (*url.URL, error)
	MockCreateIssueComment func(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, prID int, body string) error
	MockListIssueComments  func(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, prID int) ([]*model.GitHubIssueComment, error)
	MockMinimizeComment    func(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, subjectID string) error
	MockCreateCheckRun     func(ctx context.Context, id types.GitHubAppInstallID, repo *model.GitHubRepo, commit string) (int64, error)
	MockUpdateCheckRun     func(ctx context.Context, id types.GitHubAppInstallID, repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error
}

func (*GitHubMock) CreateCheckRun

func (x *GitHubMock) CreateCheckRun(ctx context.Context, id types.GitHubAppInstallID, repo *model.GitHubRepo, commit string) (int64, error)

func (*GitHubMock) CreateIssueComment

func (x *GitHubMock) CreateIssueComment(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, prID int, body string) error

func (*GitHubMock) GetArchiveURL

func (x *GitHubMock) GetArchiveURL(ctx context.Context, input *GetArchiveURLInput) (*url.URL, error)

func (*GitHubMock) ListIssueComments

func (x *GitHubMock) ListIssueComments(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, prID int) ([]*model.GitHubIssueComment, error)

func (*GitHubMock) MinimizeComment

func (x *GitHubMock) MinimizeComment(ctx context.Context, repo *model.GitHubRepo, id types.GitHubAppInstallID, subjectID string) error

func (*GitHubMock) UpdateCheckRun

func (x *GitHubMock) UpdateCheckRun(ctx context.Context, id types.GitHubAppInstallID, repo *model.GitHubRepo, checkID int64, opt *github.UpdateCheckRunOptions) error

type Policy

type Policy interface {
	Query(ctx context.Context, query string, input, output any, options ...opac.QueryOption) error
}

type Storage

type Storage interface {
	Put(ctx context.Context, key string, r io.ReadCloser) error
	Get(ctx context.Context, key string) (io.ReadCloser, error)
}

type StorageMock

type StorageMock struct {
	Data map[string][]byte
}

func NewStorageMock

func NewStorageMock() *StorageMock

func (*StorageMock) Get

func (s *StorageMock) Get(ctx context.Context, key string) (io.ReadCloser, error)

Get implements Storage.

func (*StorageMock) Put

func (s *StorageMock) Put(ctx context.Context, key string, r io.ReadCloser) error

Put implements Storage.

func (*StorageMock) Unmarshal

func (s *StorageMock) Unmarshal(key string, v interface{}) error

type UseCase

type UseCase interface {
	InsertScanResult(ctx context.Context, meta model.GitHubMetadata, report trivy.Report) error
	ScanGitHubRepo(ctx context.Context, input *model.ScanGitHubRepoInput) error
}

Jump to

Keyboard shortcuts

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