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 ¶
const Available = ccgo.Available
Available reports whether this build holds the translation.
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 ¶
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.
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 ¶
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 ¶
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. |