Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrConnectionClosed = errors.New("connection closed")
ErrConnectionClosed is returned when sending a message to a connection that is closed or in the process of closing.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface {
// Read reads the next message to process off the connection.
// Connections must allow Read to be called concurrently with Close.
Read(context.Context) (jsonrpc.Message, error)
// Write writes a new message to the connection.
// Write may be called concurrently.
Write(context.Context, jsonrpc.Message) error
// Close closes the connection.
// Close may be called multiple times, potentially concurrently.
Close() error
// SessionID returns the MCP session ID for this connection.
SessionID() string
}
Connection is a logical bidirectional JSON-RPC connection over MOQT.
type MCPHandler ¶
type MCPHandler struct {
// SessionID is the MCP session identifier
SessionID string
// ServerConn is the server connection
ServerConn *moqtServerConn
// SessionIDGenerator generates new session IDs
SessionIDGenerator func() string
// Transport is the server transport (for session management)
Transport *MOQTServerTransport
// PendingSessions stores session IDs that were created via discovery
// but don't have connections yet
PendingSessions map[string]bool
// contains filtered or unexported fields
}
MCPHandler handles general MOQT messages for MCP.
func (*MCPHandler) Handle ¶
func (h *MCPHandler) Handle(rw moqtransport.ResponseWriter, msg *moqtransport.Message)
Handle implements moqtransport.Handler.
type MCPSubscribeHandler ¶
type MCPSubscribeHandler struct {
// Transport is the server transport that manages sessions
Transport *MOQTServerTransport
// contains filtered or unexported fields
}
MCPSubscribeHandler handles MOQT subscribe messages for MCP tracks.
func (*MCPSubscribeHandler) HandleSubscribe ¶
func (h *MCPSubscribeHandler) HandleSubscribe(rw *moqtransport.SubscribeResponseWriter, msg *moqtransport.SubscribeMessage)
HandleSubscribe implements moqtransport.SubscribeHandler.
type MOQTClientTransport ¶
type MOQTClientTransport struct {
// Session is the underlying MOQT session
Session *moqtransport.Session
// SessionID is the MCP session identifier (discovered from server)
SessionID string
// Namespace is the MOQT namespace for MCP tracks
Namespace []string
// ControlTrackNamespace is the namespace for control tracks
ControlTrackNamespace []string
// contains filtered or unexported fields
}
MOQTClientTransport implements the client side of MCP over MOQT transport.
func NewMOQTClientTransport ¶
func NewMOQTClientTransport(session *moqtransport.Session) *MOQTClientTransport
NewMOQTClientTransport creates a new client transport.
func (*MOQTClientTransport) Connect ¶
func (t *MOQTClientTransport) Connect(ctx context.Context) (Connection, error)
Connect implements the Transport interface for client.
type MOQTServerTransport ¶
type MOQTServerTransport struct {
// Session is the underlying MOQT session
Session *moqtransport.Session
// SessionID is the MCP session identifier
SessionID string
// Namespace is the MOQT namespace for MCP tracks
Namespace []string
// ControlTrackNamespace is the namespace for control tracks
ControlTrackNamespace []string
// SessionConnections maps session IDs to their connections
SessionConnections map[string]*moqtServerConn
// contains filtered or unexported fields
}
MOQTServerTransport implements the server side of MCP over MOQT transport.
func NewMOQTServerTransport ¶
func NewMOQTServerTransport(session *moqtransport.Session) *MOQTServerTransport
NewMOQTServerTransport creates a new server transport.
func (*MOQTServerTransport) Connect ¶
func (t *MOQTServerTransport) Connect(ctx context.Context) (Connection, error)
Connect implements the Transport interface for server.
type MOQTTransport ¶
type MOQTTransport struct {
// Session is the underlying MOQT session
Session *moqtransport.Session
// SessionID is the MCP session identifier
SessionID string
// Namespace is the MOQT namespace for MCP tracks
Namespace []string
// ControlTrackNamespace is the namespace for control tracks
ControlTrackNamespace []string
}
MOQTTransport is a transport that communicates over MOQT.
func (*MOQTTransport) Connect ¶
func (t *MOQTTransport) Connect(ctx context.Context) (Connection, error)
Connect implements the Transport interface.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
server
command
Example server implementation for MCP over MOQT This is a placeholder example - full implementation requires proper QUIC setup
|
Example server implementation for MCP over MOQT This is a placeholder example - full implementation requires proper QUIC setup |