model

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// setup error
	ErrInvalidConfig = goerr.New("invalid config")

	// runtime error
	ErrInvalidGitHubIDToken = goerr.New("invalid GitHub ID token")
	ErrInvalidContext       = goerr.New("invalid context")

	ErrNoPolicyResult = goerr.New("no policy result")
)

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

func NewContext

func NewContext(options ...CtxOption) *Context

func (*Context) GitHubInstallID added in v0.0.3

func (x *Context) GitHubInstallID() int64

func (*Context) GitHubRepo

func (x *Context) GitHubRepo() *GitHubRepo

func (*Context) Logger

func (x *Context) Logger() *slog.Logger

func (*Context) New

func (x *Context) New(options ...CtxOption) *Context

type CtxOption

type CtxOption func(*Context)

func WithContext

func WithContext(ctx context.Context) CtxOption

func WithGitHubInstallationID added in v0.0.3

func WithGitHubInstallationID(id int64) CtxOption

func WithGitHubRepo

func WithGitHubRepo(repo *GitHubRepo) CtxOption

func WithLogger

func WithLogger(logger *slog.Logger) CtxOption

type EvalInputSarif added in v0.0.3

type EvalInputSarif struct {
	Report   sarif.Report
	Run      sarif.Run
	Result   sarif.Result
	Location sarif.Location
}

func NewEvalInputSarif added in v0.0.3

func NewEvalInputSarif(report sarif.Report, run sarif.Run, result sarif.Result, loc sarif.Location) *EvalInputSarif

type EvalInputTrivyVuln

type EvalInputTrivyVuln struct {
	Metadata *types.Metadata
	Result   *types.Result
	Vuln     *types.DetectedVulnerability
}

func NewEvalInputTrivyVuln

func NewEvalInputTrivyVuln(report types.Report, result types.Result, vuln types.DetectedVulnerability) *EvalInputTrivyVuln

type EvalOutput

type EvalOutput struct {
	Action    string   `json:"action"`
	Labels    []string `json:"labels"`
	Assignees []string `json:"assignees"`
}

type GitHubApp

type GitHubApp struct {
	AppID         GitHubAppID
	InstallID     GitHubAppInstallID
	PrivateKey    GitHubPrivateKey
	WebhookSecret GitHubSecret
}

func (*GitHubApp) Validate

func (x *GitHubApp) Validate() error

type GitHubAppID

type GitHubAppID int64

GitHub

func (GitHubAppID) Int64

func (x GitHubAppID) Int64() int64

type GitHubAppInstallID

type GitHubAppInstallID int64

GitHub

func (GitHubAppInstallID) Int64

func (x GitHubAppInstallID) Int64() int64

type GitHubIssue

type GitHubIssue struct {
	GitHubRepo
	GitHubIssueContents
	Assignees []string
	Labels    []string
}

type GitHubIssueContents

type GitHubIssueContents struct {
	Title string
	Body  string
}

type GitHubPrivateKey

type GitHubPrivateKey string

GitHub

func (GitHubPrivateKey) Byte

func (x GitHubPrivateKey) Byte() []byte

type GitHubRepo

type GitHubRepo struct {
	RepoID GitHubRepoID
	Owner  string
	Name   string
}

type GitHubRepoID

type GitHubRepoID int64

GitHub

func (GitHubRepoID) String

func (x GitHubRepoID) String() string

type GitHubSecret

type GitHubSecret string

GitHub

type RecordID

type RecordID string

GitHub

type SarifKey

type SarifKey struct {
	VulnID   string
	Location string
}

SarifKey is a key of vulnerability record for SARIF format

func (SarifKey) RecordID

func (x SarifKey) RecordID() RecordID

type TrivyLangPkgKey

type TrivyLangPkgKey struct {
	VulnID  string
	Target  string
	PkgName string
	PkgPath string
}

TrivyLangPkgKey is a key of vulnerability record for Trivy format

func (TrivyLangPkgKey) RecordID

func (x TrivyLangPkgKey) RecordID() RecordID

type TrivyOSPkgKey

type TrivyOSPkgKey struct {
	VulnID  string
	OSType  string
	PkgName string
}

/ TrivyLangPkgKey is a key of vulnerability record for Trivy format

func (TrivyOSPkgKey) RecordID

func (x TrivyOSPkgKey) RecordID() RecordID

type VulnRecord

type VulnRecord struct {
	RecordID

	RepoID         GitHubRepoID
	Owner          string
	RepoName       string
	IssueID        int
	IssueState     string
	LastModifiedAt *time.Time

	Description string
}

type VulnRecords

type VulnRecords []VulnRecord

func (VulnRecords) Find

func (x VulnRecords) Find(id RecordID) *VulnRecord

Jump to

Keyboard shortcuts

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