Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnHandler ¶
type ConnHandler func(params json.RawMessage, conn io.ReadWriter) (interface{}, error)
ConnHandler handles a request that needs the connection for binary I/O.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher routes JSON-RPC methods to handlers.
func NewDispatcher ¶
func NewDispatcher() *Dispatcher
NewDispatcher creates a dispatcher wired to all handlers.
func (*Dispatcher) CryptoSession ¶
func (d *Dispatcher) CryptoSession() *crypto.Session
CryptoSession returns the negotiated crypto session, or nil if E2E is not active.
func (*Dispatcher) Handle ¶
func (d *Dispatcher) Handle(req *proto.Request, rw io.ReadWriter)
Handle dispatches a JSON-RPC request and writes the response.
func (*Dispatcher) PtyManager ¶
func (d *Dispatcher) PtyManager() *process.PtyManager
PtyManager returns the PTY manager for binary frame routing.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the TCP server for the guest agent.
func NewServer ¶
NewServer creates a new agent server. If SANDBOX_AUTH_TOKEN is set, clients must authenticate before sending commands.
func (*Server) ListenAndServe ¶
ListenAndServe starts a TCP listener on the configured address and serves connections.
type SimpleHandler ¶
type SimpleHandler func(params json.RawMessage) (interface{}, error)
SimpleHandler handles a request that only needs params and returns a result.