Documentation
¶
Overview ¶
Package author supplies typed operations and immutable guest construction. Domain authorization remains explicit on both sides of every connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Caller ¶
type Caller interface {
Call(context.Context, plugin.ContractRef, string, json.RawMessage) (json.RawMessage, error)
}
Caller is implemented by Session and by explicit, policy-enforcing host service sessions supplied to guests. Request metadata never creates a caller.
type Method ¶
type Method[Input, Output any] struct { Contract plugin.ContractRef Operation plugin.Operation Input *schema.Schema Output *schema.Schema ValidateInput func(Input) error ValidateOutput func(Output) error }
Method is a shared typed contract. Schemas are optional, but recommended for cross-language contracts. ValidateInput/Output add domain validation.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry may be built concurrently. Guest snapshots it, so subsequent registration never expands a running guest's descriptor or dispatch table.
func NewWithSchemaEngine ¶
func NewWithSchemaEngine(identity plugin.Identity, schemas SchemaEngine) (*Registry, error)
func (*Registry) Descriptor ¶
func (r *Registry) Descriptor() plugin.Descriptor
func (*Registry) Snapshot ¶
func (r *Registry) Snapshot(opts Options) (plugin.Descriptor, plugin.GuestOptions, error)
Snapshot detaches the descriptor and dispatcher for construction by a host engine binding. Later registrations cannot expand the returned endpoint.
type SchemaEngine ¶
type SchemaEngine interface {
ValidateSchema(schema.Schema) error
CheckSchema(schema.Schema, json.RawMessage) error
}
SchemaEngine lets an embedding binding supply the shared schema mechanics. Implementations must match plugin/schema and be safe for concurrent calls.