parent
b34ba2149d
commit
0cde9623d3
2 changed files with 2 additions and 2 deletions
|
|
@ -215,7 +215,7 @@ func (s *Server) RemoveResources(uris ...string) {
|
||||||
func() bool { return s.resources.remove(uris...) })
|
func() bool { return s.resources.remove(uris...) })
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddResourceTemplate adds a [ResourceTemplate] to the server, or replaces on with the same URI.
|
// AddResourceTemplate adds a [ResourceTemplate] to the server, or replaces one with the same URI.
|
||||||
// AddResourceTemplate panics if a URI template is invalid or not absolute (has an empty scheme).
|
// AddResourceTemplate panics if a URI template is invalid or not absolute (has an empty scheme).
|
||||||
func (s *Server) AddResourceTemplate(t *ResourceTemplate, h ResourceHandler) {
|
func (s *Server) AddResourceTemplate(t *ResourceTemplate, h ResourceHandler) {
|
||||||
s.changeAndNotify(notificationResourceListChanged, &ResourceListChangedParams{},
|
s.changeAndNotify(notificationResourceListChanged, &ResourceListChangedParams{},
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ func defaultSendingMethodHandler[S Session](ctx context.Context, session S, meth
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper methods to avoid typed nil.
|
// Helper method to avoid typed nil.
|
||||||
func orZero[T any, P *U, U any](p P) T {
|
func orZero[T any, P *U, U any](p P) T {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
var zero T
|
var zero T
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue