plugin

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: 5 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 plugin is the C engine's portable core, translated to Go by ccgo (modernc.org/ccgo) and linked into the program with no C compiler and no cgo. It answers as the engine does: the descriptor, request, response, frame, manifest, schema and endpoint rules of lib/plugin, through the same service calls pkg/ext-go/cgoengine makes into the C library. The pure-Go engine is the oracle it is held against (contract/plugintest/enginetest).

The translation exists for the platforms listed in README.md. On any other, Available is false and EngineCall reports plugin.ErrUnsupported.

Index

Constants

View Source
const Available = ccgo.Available

Available reports whether this build holds the translation.

View Source
const HostAvailable = ccgo.HostAvailable

HostAvailable reports whether this build holds the translated host: sessions over Go backends and over child processes the engine owns. It is true on the platforms with the host profile (see README.md); where it is false, Open and OpenProcess report plugin.ErrUnsupported.

Variables

This section is empty.

Functions

func EngineCall

func EngineCall(operation string, input json.RawMessage) (json.RawMessage, error)

EngineCall runs one of the engine's pure services on bounded JSON, as cgoengine.EngineCall does. No plugin is executed and no policy is inferred. See lib/plugin/services.md for the services.

Types

type InstanceLease

type InstanceLease[T any] = ccgo.InstanceLease[T]

InstanceLease holds an instance until Release.

type Instances

type Instances[T any] = ccgo.Instances[T]

Instances binds typed Go resource factories to engine-owned leases, replacement, capacity and cleanup, as cgoengine.Instances does, with the engine running as Go. Close frees the engine after all outstanding leases and factories finish; a timed-out Close can be retried.

func NewInstances

func NewInstances[T any](options instance.Options[T]) (*Instances[T], error)

NewInstances creates a manager of at most options.Capacity instances.

type LaunchOptions

type LaunchOptions = ccgo.LaunchOptions

LaunchOptions starts a reviewed executable the way an installed package is run.

type ProcessOptions

type ProcessOptions = ccgo.ProcessOptions

ProcessOptions launches a reviewed executable directly, without a shell.

type Session

type Session = ccgo.Session

Session is a plugin session whose engine is the translated C host. It implements author.Caller. Close drains and frees it; Abort stops work and then frees it.

func Open

func Open(ctx context.Context, d plugin.Descriptor, options plugin.Options) (*Session, error)

Open runs a plugin over a Go backend (in-process, JSON-line, HashiCorp, WASI, native Go) from options.Connect, as cgoengine.Open does, with the engine's session logic running as Go. A plugin that declares progress events or reverse operations is refused, and options.Reverse is unsupported: neither is carried yet.

func OpenProcess

func OpenProcess(ctx context.Context, d plugin.Descriptor, launch LaunchOptions, options plugin.Options) (*Session, error)

OpenProcess is Open with the child process owned by the engine: it starts the launch, then handshakes. options.Connect is unused. The channel to the child is written in Go (os/exec).

Directories

Path Synopsis
internal
ccgo
Package ccgo holds the Go translation of the C engine's portable core (lib/plugin core_sources: the wire rules, validators, endpoint, package and frame checks, and the guest engine) and the calls into it.
Package ccgo holds the Go translation of the C engine's portable core (lib/plugin core_sources: the wire rules, validators, endpoint, package and frame checks, and the guest engine) and the calls into it.

Jump to

Keyboard shortcuts

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