commandscope

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package commandscope binds C-owned dependency snapshots to a local shell-call broker. Tokens identify consumers inside one live scope; they are not trust records.

Index

Constants

View Source
const AddressEnv = "EXT_SCOPE_ADDR"
View Source
const MaxBytes = 1 << 20
View Source
const SettingsEnv = "EXT_SCOPE_SETTINGS"
View Source
const TokenEnv = "EXT_SCOPE_TOKEN"

Variables

This section is empty.

Functions

func Relay

func Relay(ctx context.Context, args []string, input io.Reader, out, stderr io.Writer) (int, error)

Relay forwards to the host; it never loads packages or treats the address as authority. A forged endpoint can only supply output to its own caller.

Types

type Options

type Options struct {
	Root     plugin.Identity
	Rows     []Row
	Layout   storelayout.Layout
	Review   func(packagekit.Manifest) (string, error)
	Dispatch func(context.Context, *Scope, plugin.Identity, Request) (Result, error)
}

type Request

type Request struct {
	Args     []string          `json:"args"`
	Input    []byte            `json:"input,omitempty"`
	Settings map[string]string `json:"settings,omitempty"`
}

type Result

type Result struct {
	Exit   int    `json:"exit"`
	Output []byte `json:"output,omitempty"`
	Error  []byte `json:"error,omitempty"`
}

type Row

type Row struct {
	Manifest  packagekit.Manifest `json:"manifest"`
	Directory string              `json:"directory"`
	Digest    string              `json:"digest"`
}

type Scope

type Scope struct {
	Plan packagekit.Plan
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, lib *library.Described, options Options) (*Scope, error)

Open must run under the application's package writer. Release that writer before launching guests: all execution now uses the reviewed private closure.

func (*Scope) Allows

func (s *Scope) Allows(consumer, provider plugin.Identity, contract plugin.ContractRef, operation string) bool

Allows restricts nested invocation to one explicitly resolved direct dependency.

func (*Scope) Close

func (s *Scope) Close() error

func (*Scope) Environment

func (s *Scope) Environment(id plugin.Identity) []string

func (*Scope) Load

func (s *Scope) Load(id plugin.Identity) (store.Installed, error)

func (*Scope) WithEnvironment

func (s *Scope) WithEnvironment(values []string, id plugin.Identity) []string

WithEnvironment strips inherited scope hints before assigning this consumer.

Jump to

Keyboard shortcuts

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