Help us shape the future of Go! Take the 2026 Go Developer Survey

core

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEvaluationTimeout = 90 * time.Second

DefaultEvaluationTimeout is the default maximum duration of one plugin evaluation. It is longer than the inner timeouts of the checks (Yaegi: 10s, WASM: 60s).

View Source
const EvaluatorResultFD = 3

EvaluatorResultFD is the file descriptor on which the evaluator process writes its result. The plugin code can write to stdout and stderr, thus these streams do not carry the result.

View Source
const PrivateModeEnv = "PICEUS_PRIVATE_MODE"

PrivateModeEnv "private" behavior (uses GitHub instead of GoProxy).

Variables

This section is empty.

Functions

func RunEvaluation added in v0.29.0

func RunEvaluation(ctx context.Context, in io.Reader, out io.Writer, restrict func(workDir string) error) error

RunEvaluation is the entry point of the evaluator process. It reads the request from in, calls restrict before any plugin code runs, and writes the result to out. It returns an error only when the evaluation cannot run: a plugin problem is written to out.

Types

type Evaluator added in v0.29.0

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

Evaluator runs the plugin checks in a separate and sandboxed process. The process has an empty environment, and it is killed with all its children at the end of the evaluation.

func NewEvaluator added in v0.29.0

func NewEvaluator(sandboxAvailable func() error, opts ...EvaluatorOption) (*Evaluator, error)

NewEvaluator creates an Evaluator that runs the "evaluate" command of the current executable. sandboxAvailable must return an error if the sandbox cannot be enforced.

func (*Evaluator) Evaluate added in v0.29.0

func (e *Evaluator) Evaluate(ctx context.Context, req evaluationRequest) error

Evaluate runs the plugin checks described by req in the evaluator process.

type EvaluatorOption added in v0.29.0

type EvaluatorOption func(*Evaluator)

EvaluatorOption configures an Evaluator.

func WithEvaluationTimeout added in v0.29.0

func WithEvaluationTimeout(timeout time.Duration) EvaluatorOption

WithEvaluationTimeout sets the maximum duration of one plugin evaluation. At the timeout, the evaluator process and its children are killed.

type Manifest

type Manifest struct {
	DisplayName   string         `json:"displayName,omitempty" toml:"displayName,omitempty" yaml:"displayName,omitempty"`
	Runtime       string         `json:"runtime,omitempty" toml:"runtime,omitempty" yaml:"runtime,omitempty"`
	WasmPath      string         `json:"wasmPath,omitempty" toml:"wasmPath,omitempty" yaml:"wasmPath,omitempty"`
	Type          string         `json:"type,omitempty" toml:"type,omitempty" yaml:"type,omitempty"`
	Import        string         `json:"import,omitempty" toml:"import,omitempty" yaml:"import,omitempty"`
	BasePkg       string         `json:"basePkg,omitempty" toml:"basePkg,omitempty" yaml:"basePkg,omitempty"`
	Compatibility string         `json:"compatibility,omitempty" toml:"compatibility,omitempty" yaml:"compatibility,omitempty"`
	Summary       string         `json:"summary,omitempty" toml:"summary,omitempty" yaml:"summary,omitempty"`
	IconPath      string         `json:"iconPath,omitempty" toml:"iconPath,omitempty" yaml:"iconPath,omitempty"`
	BannerPath    string         `json:"bannerPath,omitempty" toml:"bannerPath,omitempty" yaml:"bannerPath,omitempty"`
	UseUnsafe     bool           `json:"useUnsafe,omitempty" toml:"useUnsafe,omitempty" yaml:"useUnsafe,omitempty"`
	TestData      map[string]any `json:"testData,omitempty" toml:"testData,omitempty" yaml:"testData,omitempty"`
}

Manifest The plugin manifest.

type PinnedCommit added in v0.29.1

type PinnedCommit func(ctx context.Context, module, version string) (string, error)

PinnedCommit returns the commit the Go module proxy pinned for module@version, or audit.ErrNotPinned.

type Scrapper

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

Scrapper the plugins scrapper.

func NewScrapper

func NewScrapper(gh *github.Client, gp *goproxy.Client, pgClient pluginClient, dryRun bool, sources Sources, pinnedCommit PinnedCommit, evaluator *Evaluator, searchQueries, searchQueriesIssues []string) *Scrapper

NewScrapper creates a new Scrapper instance.

func (*Scrapper) Run

func (s *Scrapper) Run(ctx context.Context) error

Run runs the scrapper.

type Sources

type Sources interface {
	Get(ctx context.Context, repository *github.Repository, gop string, mod module.Version, ref string) error
}

Sources gets code sources.

Jump to

Keyboard shortcuts

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