all: fix some function names and typos in comment
Change-Id: I8066b22cb87e09fb160de3b8ff2d8fdde6ec3dcf Reviewed-on: https://go-review.googlesource.com/c/tools/+/675815 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
8962b38ba5
commit
b7d1ec0604
4 changed files with 11 additions and 11 deletions
|
|
@ -114,7 +114,7 @@ func NewTextResourceContents(uri, mimeType, text string) *ResourceContents {
|
|||
}
|
||||
}
|
||||
|
||||
// NewTextResourceContents returns a [ResourceContents] containing a byte slice.
|
||||
// NewBlobResourceContents returns a [ResourceContents] containing a byte slice.
|
||||
func NewBlobResourceContents(uri, mimeType string, blob []byte) *ResourceContents {
|
||||
// The only way to distinguish text from blob is a non-nil Blob field.
|
||||
if blob == nil {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ type Server struct {
|
|||
type ServerOptions struct {
|
||||
// Optional instructions for connected clients.
|
||||
Instructions string
|
||||
// If non-nil, called when "notifications/intialized" is received.
|
||||
// If non-nil, called when "notifications/initialized" is received.
|
||||
InitializedHandler func(context.Context, *ServerSession, *InitializedParams)
|
||||
// PageSize is the maximum number of items to return in a single page for
|
||||
// list methods (e.g. ListTools).
|
||||
|
|
@ -122,7 +122,7 @@ func (s *Server) RemoveTools(names ...string) {
|
|||
func() bool { return s.tools.remove(names...) })
|
||||
}
|
||||
|
||||
// AddResource adds the given resource to the server and associates it with
|
||||
// AddResources adds the given resource to the server and associates it with
|
||||
// a [ResourceHandler], which will be called when the client calls [ClientSession.ReadResource].
|
||||
// If a resource with the same URI already exists, this one replaces it.
|
||||
// AddResource panics if a resource URI is invalid or not absolute (has an empty scheme).
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ const (
|
|||
// See https://modelcontextprotocol.io/specification/2025-03-26/server/resources#error-handling
|
||||
// However, the code they chose is in the wrong space
|
||||
// (see https://github.com/modelcontextprotocol/modelcontextprotocol/issues/509).
|
||||
// so we pick a different one, arbirarily for now (until they fix it).
|
||||
// so we pick a different one, arbitrarily for now (until they fix it).
|
||||
// The immediate problem is that jsonprc2 defines -32002 as "server closing".
|
||||
CodeResourceNotFound = -31002
|
||||
// The error code if the method exists and was called properly, but the peer does not support it.
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ type SSEServerTransport struct {
|
|||
incoming chan jsonrpc2.Message // queue of incoming messages; never closed
|
||||
|
||||
// We must guard both pushes to the incoming queue and writes to the response
|
||||
// writer, because incoming POST requests are abitrarily concurrent and we
|
||||
// writer, because incoming POST requests are arbitrarily concurrent and we
|
||||
// need to ensure we don't write push to the queue, or write to the
|
||||
// ResponseWriter, after the session GET request exits.
|
||||
mu sync.Mutex
|
||||
|
|
@ -431,7 +431,7 @@ func (c *SSEClientTransport) Connect(ctx context.Context) (Stream, error) {
|
|||
|
||||
// An sseClientStream is a logical jsonrpc2 stream that implements the client
|
||||
// half of the SSE protocol:
|
||||
// - Writes are POSTS to the sesion endpoint.
|
||||
// - Writes are POSTS to the session endpoint.
|
||||
// - Reads are SSE 'message' events, and pushes them onto a buffered channel.
|
||||
// - Close terminates the GET request.
|
||||
type sseClientStream struct {
|
||||
|
|
|
|||
Loading…
Reference in a new issue