Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSessionClosed = errors.New("session closed")
Functions ¶
This section is empty.
Types ¶
type Discard ¶
type Discard struct{}
Discard is a transport that discards all data. Discard reads and writes are no-ops. This is useful for testing.
type Generic ¶
type Generic struct {
// contains filtered or unexported fields
}
Generic is a transport for the Model Context Protocol that uses the standard input and output.
func NewGeneric ¶
NewGeneric creates a new Transport that uses the standard input and output.
func NewStdio ¶
func NewStdio() *Generic
NewStdio creates a new Transport that uses the standard input and output.
func (*Generic) Close ¶
Close closes the transport's reader and writer if they implement io.Closer. It avoids closing the same resource twice if reader and writer are identical.
type JSONReceiver ¶
type JSONReceiver interface {
Receive() iter.Seq[json.RawMessage]
}
type JSONSender ¶
type JSONSender interface {
Send(v json.RawMessage) error
}
type SSESession ¶
type SSESession struct {
// contains filtered or unexported fields
}
func (*SSESession) Close ¶
func (s *SSESession) Close() error
func (*SSESession) Receive ¶
func (s *SSESession) Receive() iter.Seq[json.RawMessage]
func (*SSESession) Send ¶
func (s *SSESession) Send(v json.RawMessage) error
type Session ¶
type Session interface {
JSONSender
JSONReceiver
io.Closer
}
type SessionHandler ¶
type SessionHandlerFunc ¶
func (SessionHandlerFunc) HandleSession ¶
Click to show internal directories.
Click to hide internal directories.