host

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package host provides the supported public construction path for executable backend-plugin contract clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtocolViolationError

type ProtocolViolationError struct{ Err error }

ProtocolViolationError preserves the distinction between malformed protocol frames and transport failures for internal host adapters.

func (*ProtocolViolationError) Error

func (e *ProtocolViolationError) Error() string

func (*ProtocolViolationError) Unwrap

func (e *ProtocolViolationError) Unwrap() error

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is the public host-facing configured connector boundary.

func DialConfiguredSession

func DialConfiguredSession(ctx context.Context, conn net.Conn, instanceID, factoryKind string, configYAML []byte, secrets backendplugin.SecretBundle, policy backendplugin.RuntimePolicy) (*Session, backendplugin.ResolvedProfile, error)

DialConfiguredSession negotiates, configures, and resolves a plugin over an already authenticated connection. The caller owns conn until Close.

func NewSessionForTesting

func NewSessionForTesting(client backendpluginv1.BackendPluginClient, conn *grpc.ClientConn, instanceID string, negotiation backendplugin.Negotiation) *Session

NewSession binds an already-created gRPC client to a host session. It is intended for standard-distribution composition tests; connector authors should normally use DialConfiguredSession.

func (*Session) Cancel

func (s *Session) Cancel(ctx context.Context, invocation backendplugin.Invocation) error

func (*Session) Close

func (s *Session) Close(ctx context.Context) error

func (*Session) CountTokens

CountTokens forwards the optional token-counting operation.

func (*Session) Execute

func (s *Session) Execute(stream backendplugin.ExecuteStream) error

Execute forwards the public DTO stream through the gRPC host session.

Executes serialize on one session and with Close through the session lifecycle: Close waits for the active stream to drain before tearing down the transport, and each Execute registers a cancellation that a deadline-bound Close can trigger. The lifecycle mutex is only held for registration, never across the RPC; the execMu serialization below is what Close deliberately does not take.

func (*Session) FinalizeBilling

FinalizeBilling forwards the optional billing-finalization operation.

func (*Session) ListModels

func (s *Session) ListModels(ctx context.Context, maxModels uint32) (backendplugin.ListModelsResponse, error)

func (*Session) Negotiation

func (s *Session) Negotiation() backendplugin.Negotiation

Negotiation returns the protocol outcome bound at dial time.

func (*Session) ReleasePromptCache

func (s *Session) ReleasePromptCache(ctx context.Context, req promptcache.ReleaseRequest) error

ReleasePromptCache forwards the optional local-forget operation.

func (*Session) RenewPromptCache

func (s *Session) RenewPromptCache(ctx context.Context, req promptcache.RenewRequest) (promptcache.RenewResponse, error)

RenewPromptCache forwards the optional instance-scoped control operation.

func (*Session) Resolve

func (s *Session) Resolve(ctx context.Context, modelID *string) (backendplugin.ResolvedProfile, error)

Jump to

Keyboard shortcuts

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