trusty

package
v0.0.35 Latest Latest
Warning

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

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

Documentation

Overview

Package trusty provides an evaluator that uses the trusty API

Package trusty provides an evaluator that uses the trusty API

Package trusty provides an evaluator that uses the trusty API

Package trusty provides an evaluator that uses the trusty API

Index

Constants

View Source
const (
	// TrustyEvalType is the type of the trusty evaluator
	TrustyEvalType = "trusty"
)

Variables

View Source
var (
	// SummaryScore is the score to use for the summary score
	SummaryScore = "score"
	// DefaultScore is the default score to use
	DefaultScore = ""
)

Functions

This section is empty.

Types

type Alternative

type Alternative struct {
	PackageName    string  `json:"package_name"`
	Score          float64 `json:"score"`
	PackageNameURL string
}

Alternative is an alternative package returned from the package intelligence API

type Evaluator

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

Evaluator is the trusty evaluator

func NewTrustyEvaluator

func NewTrustyEvaluator(ctx context.Context, pbuild *providers.ProviderBuilder) (*Evaluator, error)

NewTrustyEvaluator creates a new trusty evaluator

func (*Evaluator) Eval

func (e *Evaluator) Eval(ctx context.Context, pol map[string]any, res *engif.Result) error

Eval implements the Evaluator interface.

type Reply

type Reply struct {
	PackageName  string       `json:"package_name"`
	PackageType  string       `json:"package_type"`
	Summary      ScoreSummary `json:"summary"`
	Alternatives struct {
		Status   string        `json:"status"`
		Packages []Alternative `json:"packages"`
	} `json:"alternatives"`
}

Reply is the response from the package intelligence API

type ScoreSummary added in v0.0.28

type ScoreSummary struct {
	Score       float64        `json:"score"`
	Description map[string]any `json:"description"`
}

ScoreSummary is the summary score returned from the package intelligence API

Jump to

Keyboard shortcuts

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