Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppConsoleHandler ¶
type AppConsoleHandler struct {
// contains filtered or unexported fields
}
AppConsoleHandler handles WebSocket connections for application-level console sessions.
func NewAppConsoleHandler ¶
func NewAppConsoleHandler(log logrus.FieldLogger, mgr *console.AppConsoleSessionManager) *AppConsoleHandler
NewAppConsoleHandler returns an AppConsoleHandler that upgrades HTTP connections to WebSocket and bridges them to AppConsoleSessions.
func (*AppConsoleHandler) HandleApplicationConsole ¶
func (h *AppConsoleHandler) HandleApplicationConsole(w http.ResponseWriter, r *http.Request)
HandleApplicationConsole upgrades the HTTP connection to WebSocket and bridges it bidirectionally to the AppConsoleSession for the given device and application.
func (*AppConsoleHandler) RegisterRoutes ¶
func (h *AppConsoleHandler) RegisterRoutes(r chi.Router)
RegisterRoutes mounts the application console WebSocket endpoint.
type Server ¶
type Server struct {
pb.UnimplementedRouterServiceServer
// contains filtered or unexported fields
}
Server provides the flightctl-remote-access service: a WebSocket HTTP server and a gRPC RouterService that bridges agent streams to active AppConsoleSessions.
func New ¶
func New( log logrus.FieldLogger, cfg *config.Config, caBundleCerts []*x509.Certificate, serverCerts *crypto.TLSCertificateConfig, db *gorm.DB, notifier console.ConsoleEventNotifier, ) (*Server, error)
New returns a new Server. All initialisation requiring a context (listeners, auth, router) is deferred to Run(), matching the imagebuilder-api pattern.
func (*Server) CloseSession ¶
func (s *Server) CloseSession(session *console.AppConsoleSession) error
CloseSession removes a previously registered AppConsoleSession.
func (*Server) Run ¶
Run initialises all runtime components (listeners, auth, router, gRPC) and blocks until ctx is cancelled or a listener exits unexpectedly.
func (*Server) StartSession ¶
func (s *Server) StartSession(session *console.AppConsoleSession) error
StartSession registers an AppConsoleSession so the next gRPC Stream() call from the agent can rendezvous with it.
func (*Server) Stream ¶
func (s *Server) Stream(stream pb.RouterService_StreamServer) error
Stream implements pb.RouterServiceServer. When the agent connects it reads the x-session-id gRPC metadata key, looks up the matching AppConsoleSession, sends the selected protocol to ProtocolCh, and forwards bytes bidirectionally.