Documentation
¶
Overview ¶
Package hostconnections provides invocation-scoped access to host-owned connections.
Index ¶
Constants ¶
const Version uint32 = 2
Version is the negotiated host callback protocol version.
Variables ¶
ErrHostConnectionsUnavailable rejects calls without a live process binding.
Functions ¶
func RegisterServer ¶
func RegisterServer(reg grpc.ServiceRegistrar, service Service)
RegisterServer installs a bounded, strictly decoded callback service.
Types ¶
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
Binding owns the callback connection for one plugin process. An accepted binding cannot be replaced, even after Close.
func (*Binding) Bind ¶
func (b *Binding) Bind(conn *grpc.ClientConn) error
Bind accepts one callback connection; the caller retains ownership on failure.
type Client ¶
type Client interface {
Catalog(context.Context, string, resourcev2.CatalogRequest) (resourcev2.Catalog, error)
ResolveTarget(context.Context, string, ResolveTargetRequest) (ResolvedTarget, error)
ResolveSchema(context.Context, string, resourcev2.SchemaRequest) (resourcev2.SchemaBinding, error)
GetSchemaDocument(context.Context, string, resourcev2.SchemaDocumentRequest) (resourcev2.SchemaDocument, error)
Get(context.Context, string, string, resourcev2.GetRequest) (resourcev2.Record, error)
Enumerate(context.Context, string, string, resourcev2.EnumerateRequest) (resourcev2.SourcePage, error)
Update(context.Context, string, string, resourcev2.MutationRequest) (resourcev2.Record, error)
}
Client exposes owner operations within one delegated tool invocation.
type ResolveTargetRequest ¶
type ResolveTargetRequest struct {
Route resourcev2.AccessRoute
Type string
Scope resourcev2.QueryScope
Representation string
}
ResolveTargetRequest selects a host-authorized target through the owner route.
type ResolvedTarget ¶
type ResolvedTarget struct {
TargetID string
Target resourcev2.ReadTarget
}
ResolvedTarget includes the opaque host ID required by finite operations.
type Service ¶
type Service interface {
Catalog(context.Context, []byte, string, resourcev2.CatalogRequest) (resourcev2.Catalog, error)
ResolveTarget(context.Context, []byte, string, ResolveTargetRequest) (ResolvedTarget, error)
ResolveSchema(context.Context, []byte, string, resourcev2.SchemaRequest) (resourcev2.SchemaBinding, error)
GetSchemaDocument(context.Context, []byte, string, resourcev2.SchemaDocumentRequest) (resourcev2.SchemaDocument, error)
Get(context.Context, []byte, string, string, resourcev2.GetRequest) (resourcev2.Record, error)
Enumerate(context.Context, []byte, string, string, resourcev2.EnumerateRequest) (resourcev2.SourcePage, error)
Update(context.Context, []byte, string, string, resourcev2.MutationRequest) (resourcev2.Record, error)
}
Service is the host boundary for one consumer process. Implementations must authorize each token, owner, route, target, and operation, including the current generation and final access check. Schema document references identify content; they do not grant access to another schema target.