pluginhostsdk

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxResponseBytes = 1 << 20

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatchRequest

type DispatchRequest struct {
	PackageID          string
	PackageVersion     string
	RouteGeneration    uint64
	RequestID          string
	IdempotencyKey     string
	RouteID            string
	Method             string
	RequestBody        []byte
	PrincipalJSON      []byte
	Metadata           RequestMetadata
	BridgeCapability   []byte
	DeadlineUnixMillis int64
}

type DispatchResponse

type DispatchResponse struct {
	StatusCode   uint32
	ResponseBody []byte
	Headers      []Header
	OperationID  string
	FailureCode  string
}

type DrainResponse

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

type HealthResponse

type HealthResponse struct {
	Healthy     bool
	LeaseID     string
	DetailsJSON string
}

type MigrationRequest

type MigrationRequest struct {
	PackageID          string
	PackageVersion     string
	MigrationID        string
	Checkpoint         string
	RouteGeneration    uint64
	BridgeCapability   []byte
	DeadlineUnixMillis int64
}

type MigrationResponse

type MigrationResponse struct {
	Checkpoint       string
	ValidationDigest string
	Complete         bool
	FailureCode      string
}

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"`
}

RequestMetadata is kernel-provided HTTP address metadata. It is distinct from signed route selection and lets a package preserve the legacy v2 request contract without consulting kernel routing state.

type Server

type Server struct {
	pluginhostv1.UnimplementedControlPackageHostServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config ServerConfig, packageImpl Package) (*Server, error)

func (*Server) Dispatch

func (*Server) Drain

func (*Server) Health

func (*Server) Migrate

func (*Server) OpenWebSocket

type ServerConfig

type ServerConfig struct {
	PackageID        string
	PackageVersion   string
	MaxResponseBytes int
}

type WebSocketClose

type WebSocketClose struct {
	Code   uint32
	Reason string
}

type WebSocketFrame

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

WebSocketFrame is a post-open package-host frame. A nil Close denotes a data frame, including an empty opaque payload.

type WebSocketOpen

type WebSocketOpen struct {
	PackageID          string
	PackageVersion     string
	RouteGeneration    uint64
	RouteID            string
	PrincipalJSON      []byte
	Metadata           RequestMetadata
	RequestID          string
	IdempotencyKey     string
	DeadlineUnixMillis int64
	BridgeCapability   []byte
}

type WebSocketPackage

type WebSocketPackage interface {
	OpenWebSocket(context.Context, WebSocketOpen, WebSocketStream) error
}

WebSocketPackage is intentionally optional so a host cannot accidentally claim WebSocket support merely by implementing unary package methods.

type WebSocketStream

type WebSocketStream interface {
	Recv() (WebSocketFrame, error)
	Send(WebSocketFrame) error
}

Jump to

Keyboard shortcuts

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