Documentation
¶
Index ¶
- type AgentConn
- func (a *AgentConn) Authenticate(token string, timeout time.Duration) error
- func (a *AgentConn) Close() error
- func (a *AgentConn) Ping(timeout time.Duration) error
- func (a *AgentConn) ReadFrame() (byte, []byte, error)
- func (a *AgentConn) SetDeadline(t time.Time) error
- func (a *AgentConn) SetReadDeadline(t time.Time) error
- func (a *AgentConn) SetWriteDeadline(t time.Time) error
- func (a *AgentConn) WriteFrame(frameType byte, payload []byte) error
- type Dialer
- type Session
- type TCPDialer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentConn ¶
type AgentConn struct {
// contains filtered or unexported fields
}
AgentConn manages a binary-framed connection to a guest agent.
func (*AgentConn) Authenticate ¶
Authenticate sends an auth.token RPC to the agent and verifies the response. Must be called before any other RPC when the agent requires a token.
func (*AgentConn) ReadFrame ¶
ReadFrame reads a binary-framed message. Returns (type, payload, error).
func (*AgentConn) SetDeadline ¶
SetDeadline sets the read and write deadline on the connection.
func (*AgentConn) SetReadDeadline ¶
SetReadDeadline sets the read deadline.
func (*AgentConn) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline.
type Dialer ¶
Dialer abstracts how connections are established to guest agents. The default implementation dials TCP, but alternatives (e.g., vsock for Firecracker microVMs) can be provided by implementing this interface.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session bridges a client WebSocket connection to a guest agent TCP connection. It translates JSON-RPC messages from the client into binary frames for the agent and relays responses and notifications back.
func NewSession ¶
NewSession creates a new proxy session.
func (*Session) Done ¶
func (s *Session) Done() <-chan struct{}
Done returns a channel that is closed when the session ends.
func (*Session) SendNotification ¶
SendNotification sends a JSON-RPC notification to the client over WebSocket.
func (*Session) SendRawJSON ¶
SendRawJSON sends pre-marshaled JSON data as a text WebSocket message.