sse

package
v0.0.0-...-b198e9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles SSE connections and messages.

func NewHandler

func NewHandler(sessionMgr *session.Manager, agentCfg config.AgentConfig) *Handler

NewHandler creates a new SSE handler with default security settings.

func NewHandlerWithSecurity

func NewHandlerWithSecurity(sessionMgr *session.Manager, agentCfg config.AgentConfig, securityCfg config.SecurityConfig) *Handler

NewHandlerWithSecurity creates a new SSE handler with custom security configuration.

func (*Handler) HandleMessage

func (h *Handler) HandleMessage(w http.ResponseWriter, r *http.Request)

HandleMessage handles incoming MCP messages (POST /message).

func (*Handler) HandleSSE

func (h *Handler) HandleSSE(w http.ResponseWriter, r *http.Request)

HandleSSE handles the SSE stream connection (GET /).

func (*Handler) SetMessageHandler

func (h *Handler) SetMessageHandler(handler MessageHandler)

SetMessageHandler sets the callback for processing messages.

type MessageHandler

type MessageHandler = transport.MessageHandler

MessageHandler is an alias for the transport.MessageHandler type.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements the SSE transport for MCP.

func NewServer

func NewServer(cfg config.ServerConfig, agentCfg config.AgentConfig, sessionMgr *session.Manager) *Server

NewServer creates a new SSE transport server.

func (*Server) Name

func (s *Server) Name() string

Name returns the transport name.

func (*Server) SetMessageHandler

func (s *Server) SetMessageHandler(h MessageHandler)

SetMessageHandler sets the callback for processing incoming messages.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Start begins accepting SSE connections.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop gracefully shuts down the server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL