server

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	LATEST_PROTOCOL_VERSION = "2024-11-05"
)

Variables

View Source
var (
	SUPPORTED_PROTOCOL_VERSIONS = []string{
		LATEST_PROTOCOL_VERSION,
		"2024-10-07",
	}
)

Functions

This section is empty.

Types

type InitializationFininshedHandlerOption

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

type LoggerOption

type LoggerOption struct {
	Logger foxyevent.Logger
}

type Server

type Server interface {
	Handle(b []byte)
	GetResponses() chan jsonrpc2.JsonRpcResponse
	SetRequestHandler(request jsonrpc2.Request, handler func(req jsonrpc2.Request) (jsonrpc2.Result, *jsonrpc2.Error))
	SetNotificationHandler(request jsonrpc2.Request, handler func(req jsonrpc2.Request))
	SetLogger(logger foxyevent.Logger)
	GetLogger() foxyevent.Logger
}

func NewServer

func NewServer(
	capabilities *mcp.ServerCapabilities,
	serverInfo *mcp.Implementation,
	options ...ServerOption,
) Server

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

type ServerStartCallbackOption

type ServerStartCallbackOption struct {
	Callback func(s Server)
}

type Transport

type Transport interface {
	Run(
		capabilities *mcp.ServerCapabilities,
		serverInfo *mcp.Implementation,
		serverOptions ...ServerOption,
	) error

	Shutdown(context.Context) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳