Documentation
¶
Index ¶
- type ContentHandler
- type Server
- func (s *Server) NotifyResourceUpdated(ctx context.Context, uri string) error
- func (s *Server) RegisterContentHandler(uriPrefix string, handler ContentHandler)
- func (s *Server) SetResources(ctx context.Context, resources []types.Resource) error
- func (s *Server) SetTemplates(ctx context.Context, templates []types.ResourceTemplate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentHandler ¶
ContentHandler is a function that returns the contents of a resource
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides server-side resource functionality
func NewServer ¶
func NewServer(base *base.Base, initialResources []types.Resource, initialTemplates []types.ResourceTemplate) *Server
NewServer creates a new Server
func (*Server) NotifyResourceUpdated ¶
NotifyResourceUpdated notifies subscribers that a resource has changed
func (*Server) RegisterContentHandler ¶
func (s *Server) RegisterContentHandler(uriPrefix string, handler ContentHandler)
RegisterContentHandler registers a handler for reading resource contents
func (*Server) SetResources ¶
SetResources updates the list of available resources
func (*Server) SetTemplates ¶
func (s *Server) SetTemplates(ctx context.Context, templates []types.ResourceTemplate)
SetTemplates updates the list of resource templates
Click to show internal directories.
Click to hide internal directories.