hostconnections

package
v0.14.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 9 Imported by: 1 module, 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 hostconnections provides invocation-scoped access to host-owned connections.

Index

Constants

View Source
const Version uint32 = 1

Version is the negotiated host callback protocol version.

Variables

View Source
var ErrHostConnectionsUnavailable = errors.New("host connections service is unavailable")

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.

func (*Binding) Close

func (b *Binding) Close() error

Close retires an accepted connection without permitting its replacement.

func (*Binding) Context

func (b *Binding) Context(ctx context.Context, owner string, route resourcev2.AccessRoute, token []byte) (context.Context, error)

Context freezes the invocation owner, route, and copied opaque token. A missing binding or selector fails before a consumer handler can run.

type Client

Client exposes owner operations within one delegated tool invocation.

func FromContext

func FromContext(ctx context.Context) (Client, error)

FromContext returns the invocation client, never a global connection.

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

Service is the host boundary for one consumer process. Implementations must authorize each token, owner, route, target, and operation.

Jump to

Keyboard shortcuts

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