Documentation
¶
Index ¶
- Constants
- type DispatchRequest
- type DispatchResponse
- type DrainResponse
- type Header
- type HealthResponse
- type MigrationRequest
- type MigrationResponse
- type Package
- type RequestMetadata
- type Server
- func (s *Server) Dispatch(ctx context.Context, request *pluginhostv1.DispatchRequest) (*pluginhostv1.DispatchResponse, error)
- func (s *Server) Drain(ctx context.Context, request *pluginhostv1.DrainRequest) (*pluginhostv1.DrainResponse, error)
- func (s *Server) Health(ctx context.Context, request *pluginhostv1.HealthRequest) (*pluginhostv1.HealthResponse, error)
- func (s *Server) Migrate(ctx context.Context, request *pluginhostv1.MigrationRequest) (*pluginhostv1.MigrationResponse, error)
- func (s *Server) OpenWebSocket(stream pluginhostv1.ControlPackageHost_OpenWebSocketServer) error
- type ServerConfig
- type WebSocketClose
- type WebSocketFrame
- type WebSocketOpen
- type WebSocketPackage
- type WebSocketStream
Constants ¶
View Source
const DefaultMaxResponseBytes = 1 << 20
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DispatchRequest ¶
type DispatchResponse ¶
type DrainResponse ¶
type HealthResponse ¶
type MigrationRequest ¶
type MigrationResponse ¶
type Package ¶
type Package interface {
Dispatch(context.Context, DispatchRequest) (DispatchResponse, error)
Migrate(context.Context, MigrationRequest) (MigrationResponse, error)
Health(context.Context) (HealthResponse, error)
Drain(context.Context) (DrainResponse, error)
}
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 (*Server) Dispatch ¶
func (s *Server) Dispatch(ctx context.Context, request *pluginhostv1.DispatchRequest) (*pluginhostv1.DispatchResponse, error)
func (*Server) Drain ¶
func (s *Server) Drain(ctx context.Context, request *pluginhostv1.DrainRequest) (*pluginhostv1.DrainResponse, error)
func (*Server) Health ¶
func (s *Server) Health(ctx context.Context, request *pluginhostv1.HealthRequest) (*pluginhostv1.HealthResponse, error)
func (*Server) Migrate ¶
func (s *Server) Migrate(ctx context.Context, request *pluginhostv1.MigrationRequest) (*pluginhostv1.MigrationResponse, error)
func (*Server) OpenWebSocket ¶
func (s *Server) OpenWebSocket(stream pluginhostv1.ControlPackageHost_OpenWebSocketServer) error
type ServerConfig ¶
type WebSocketClose ¶
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 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
}
Click to show internal directories.
Click to hide internal directories.