pluginhost

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package pluginhost exposes fail-closed stubs on platforms that cannot provide the Unix socket and descriptor isolation required by package hosts.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHostUnavailable       = errors.New("plugin host unavailable")
	ErrHostNotFound          = errors.New("plugin host not found")
	ErrHostIncompatible      = errors.New("plugin host incompatible")
	ErrGenerationUnavailable = errors.New("plugin host generation unavailable")
)

Functions

func SetDefaultManager

func SetDefaultManager(manager Manager)

Types

type ArtifactRef

type ArtifactRef struct {
	PackageID        string
	Version          string
	ArtifactPath     string
	ArtifactSHA256   string
	EntrypointPath   string
	EntrypointSHA256 string
	ManifestPath     string
	ManifestSHA256   string
}

type DispatchInput

type DispatchInput struct {
	PackageID        string
	Version          string
	Generation       uint64
	RequestID        string
	IdempotencyKey   string
	RouteID          string
	Method           string
	Body             []byte
	PrincipalJSON    []byte
	Metadata         RequestMetadata
	BridgeCapability []byte
	Deadline         time.Time
}

type DispatchOutput

type DispatchOutput struct {
	StatusCode  uint32
	Body        []byte
	Headers     []Header
	OperationID string
	FailureCode string
}

type DrainResult

type DrainResult struct {
	Drained  bool
	InFlight uint64
}
type Header struct {
	Name  string
	Value string
}

type HostHealth

type HostHealth struct {
	Healthy     bool
	LeaseID     string
	DetailsJSON string
}

type ManagerConfig

type ManagerConfig struct {
	RuntimeDir     string
	StartupTimeout time.Duration
	BridgeFactory  packagebridge.SessionFactory
}

type MigrationCheckpointRecorder

type MigrationCheckpointRecorder func(context.Context, MigrationOutput) error

type MigrationInput

type MigrationInput struct {
	PackageID        string
	Version          string
	MigrationID      string
	Checkpoint       string
	Generation       uint64
	BridgeCapability []byte
	Deadline         time.Time
}

type MigrationManager

type MigrationManager interface {
	Migrate(context.Context, MigrationInput, MigrationCheckpointRecorder) (MigrationOutput, error)
}

type MigrationOutput

type MigrationOutput struct {
	Checkpoint       string
	ValidationDigest string
	Complete         bool
	FailureCode      string
	HealthLeaseID    string
	HealthGeneration uint64
}

type RequestMetadata

type RequestMetadata struct {
	Path                             string              `json:"path,omitempty"`
	Query                            map[string][]string `json:"query,omitempty"`
	Headers                          map[string][]string `json:"headers,omitempty"`
	PathParams                       map[string]string   `json:"path_params,omitempty"`
	ClientIP                         string              `json:"client_ip,omitempty"`
	UserAgent                        string              `json:"user_agent,omitempty"`
	NodeID                           uint                `json:"node_id,omitempty"`
	TrustedAgentWebSocketAuth        bool                `json:"trusted_agent_websocket_auth,omitempty"`
	TrustedAgentWebSocketForwardNode bool                `json:"trusted_agent_websocket_forward_node,omitempty"`
}

type Supervisor

type Supervisor struct{}

func NewManager

func NewManager(ManagerConfig) (*Supervisor, error)

func (*Supervisor) Close

func (*Supervisor) Close() error

func (*Supervisor) Dispatch

func (*Supervisor) Drain

func (*Supervisor) Health

func (*Supervisor) OpenWebSocket

func (*Supervisor) Rollback

func (*Supervisor) Shutdown

func (*Supervisor) Shutdown(context.Context) error

func (*Supervisor) Start

func (*Supervisor) Stop

type WebSocketClose

type WebSocketClose struct {
	Code   uint32
	Reason string
}

type WebSocketFrame

type WebSocketFrame struct {
	Data  []byte
	Close *WebSocketClose
}

type WebSocketInput

type WebSocketInput struct {
	PackageID        string
	Version          string
	Generation       uint64
	RouteID          string
	PrincipalJSON    []byte
	Metadata         RequestMetadata
	RequestID        string
	IdempotencyKey   string
	BridgeCapability []byte
	Deadline         time.Time
}

type WebSocketManager

type WebSocketManager interface {
	OpenWebSocket(context.Context, WebSocketInput) (*WebSocketRelay, error)
}

type WebSocketRelay

type WebSocketRelay struct{}

func (*WebSocketRelay) Close

func (*WebSocketRelay) Recv

func (*WebSocketRelay) Recv() (WebSocketFrame, error)

func (*WebSocketRelay) Send

Jump to

Keyboard shortcuts

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