Versions in this module Expand all Collapse all v1 v1.0.0 Nov 4, 2025 Changes in this version + const MaxDevices + type Device struct + Conn *jsonrpc2.Conn + ConnectedAt time.Time + ID string + Name string + Sessions map[string]*Session + func NewDevice() *Device + func (d *Device) AddSession(session *Session) + func (d *Device) GetSession(sessionID string) (*Session, bool) + func (d *Device) RemoveSession(sessionID string) + func (d *Device) SessionCount() int + type Handler struct + func NewHandler(server *Server, device *Device) *Handler + func (h *Handler) Handle(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) + type Server struct + func New() *Server + func NewWithSecurityKey(securityKey string) *Server + func (s *Server) AddDevice(device *Device) + func (s *Server) GetDevice(deviceID string) (*Device, bool) + func (s *Server) HandleWebSocket(w http.ResponseWriter, r *http.Request) + func (s *Server) ListDevices() []string + func (s *Server) RemoveDevice(deviceID string) + func (s *Server) Start(addr string) error + func (s *Server) StartTLS(addr string, certFile string, keyFile string) error + type Session struct + AgentID string + ClientConn *jsonrpc2.Conn + Done chan struct{} + ID string + Input chan []byte + Output chan []byte + func NewSession(id, agentID string) *Session + func NewSessionWithClient(id, agentID string, clientConn *jsonrpc2.Conn) *Session