Documentation
¶
Overview ¶
Package perception binds the portable intelligence.perception/v1 contract to Ext plugin sessions. Its wire payloads are defined by src/ctn/contract/perception.
Index ¶
- Constants
- Variables
- func Descriptor(identity plugin.Identity) plugin.Descriptor
- func PackageExecutable(options ExecutablePackage) (packagekit.Manifest, error)
- func RegisterProvider(registry *author.Registry, provider domain.Provider, ...) (*plugin.Descriptor, error)
- func ServeCurrentExecutable(ctx context.Context, id, version string, provider domain.Provider, ...) error
- func ServeStdio(ctx context.Context, identity plugin.Identity, provider domain.Provider, ...) error
- type Client
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) Info(ctx context.Context) (domain.Info, error)
- func (c *Client) Interpret(ctx context.Context, request domain.InterpretRequest) (domain.InterpretResponse, error)
- func (c *Client) Observe(ctx context.Context, request domain.ObserveRequest) (domain.ObserveResponse, error)
- type ExecutablePackage
Constants ¶
const ContractName = "intelligence.perception"
const ContractVersion = "v1"
const Protocol = ContractName + "/" + ContractVersion
Variables ¶
var ContractRef = plugin.ContractRef{Name: ContractName, Version: ContractVersion}
Functions ¶
func Descriptor ¶
func Descriptor(identity plugin.Identity) plugin.Descriptor
Descriptor is the stable provider surface used by process hosts.
func PackageExecutable ¶
func PackageExecutable(options ExecutablePackage) (packagekit.Manifest, error)
PackageExecutable seals a provider for the current or selected platform. The descriptor declares the complete surface; runtime capabilities still decide which optional operations the provider serves.
func RegisterProvider ¶
func RegisterProvider(registry *author.Registry, provider domain.Provider, authorize func(context.Context, plugin.Request) error) (*plugin.Descriptor, error)
RegisterProvider declares the stable surface. An unsupported optional operation returns a typed remote error. Authorize is required on every call.
func ServeCurrentExecutable ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client invokes a provider through an already authorized plugin session.
func (*Client) Interpret ¶
func (c *Client) Interpret(ctx context.Context, request domain.InterpretRequest) (domain.InterpretResponse, error)
func (*Client) Observe ¶
func (c *Client) Observe(ctx context.Context, request domain.ObserveRequest) (domain.ObserveResponse, error)
type ExecutablePackage ¶
type ExecutablePackage struct {
ID, Version, Binary, OutputDir, OS, Arch string
}