Documentation
¶
Index ¶
Constants ¶
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).
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.
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.
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
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.