server

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server)

func WithCapabilities

func WithCapabilities(capabilities protocol.ServerCapabilities) Option

func WithInstructions

func WithInstructions(instructions string) Option

func WithLogger

func WithLogger(logger pkg.Logger) Option

func WithServerInfo

func WithServerInfo(serverInfo protocol.Implementation) Option

func WithSessionMaxIdleTime added in v0.1.10

func WithSessionMaxIdleTime(maxIdleTime time.Duration) Option

type Server

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

func NewServer

func NewServer(t transport.ServerTransport, opts ...Option) (*Server, error)

func (*Server) Ping added in v0.1.6

func (server *Server) Ping(ctx context.Context, request *protocol.PingRequest) (*protocol.PingResult, error)

func (*Server) RegisterPrompt

func (server *Server) RegisterPrompt(prompt *protocol.Prompt, promptHandler PromptHandlerFunc)

func (*Server) RegisterResource

func (server *Server) RegisterResource(resource *protocol.Resource, resourceHandler ResourceHandlerFunc)

func (*Server) RegisterResourceTemplate

func (server *Server) RegisterResourceTemplate(resource *protocol.ResourceTemplate, resourceHandler ResourceHandlerFunc) error

func (*Server) RegisterTool

func (server *Server) RegisterTool(tool *protocol.Tool, toolHandler ToolHandlerFunc)

func (*Server) Run

func (server *Server) Run() error

func (*Server) SendNotification4ResourcesUpdated

func (server *Server) SendNotification4ResourcesUpdated(ctx context.Context, notify *protocol.ResourceUpdatedNotification) error

func (*Server) Shutdown

func (server *Server) Shutdown(userCtx context.Context) error

func (*Server) UnregisterPrompt

func (server *Server) UnregisterPrompt(name string)

func (*Server) UnregisterResource

func (server *Server) UnregisterResource(uri string)

func (*Server) UnregisterResourceTemplate

func (server *Server) UnregisterResourceTemplate(uriTemplate string)

func (*Server) UnregisterTool

func (server *Server) UnregisterTool(name string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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