internal/mcp: rename StdIO->Stdio
In CL 682976, Alan Donovan correctly points out that the term in the MCP spec is 'stdio', and therefore the correct capitalization is Stdio. Change-Id: Ib5bbe04f1a61de886298b4d0adc13aefd6aadd9c Reviewed-on: https://go-review.googlesource.com/c/tools/+/683075 Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
f4ed9b5904
commit
a590cfe063
1 changed files with 16 additions and 16 deletions
|
|
@ -110,16 +110,16 @@ func NewCommandTransport(cmd *exec.Command) *CommandTransport
|
|||
func (*CommandTransport) Connect(ctx context.Context) (Connection, error) {
|
||||
```
|
||||
|
||||
The `StdIOTransport` is the server side of the stdio transport, and connects by binding to `os.Stdin` and `os.Stdout`.
|
||||
The `StdioTransport` is the server side of the stdio transport, and connects by binding to `os.Stdin` and `os.Stdout`.
|
||||
|
||||
```go
|
||||
// A StdIOTransport is a [Transport] that communicates using newline-delimited
|
||||
// A StdioTransport is a [Transport] that communicates using newline-delimited
|
||||
// JSON over stdin/stdout.
|
||||
type StdIOTransport struct { /* unexported fields */ }
|
||||
type StdioTransport struct { /* unexported fields */ }
|
||||
|
||||
func NewStdIOTransport() *StdIOTransport
|
||||
func NewStdioTransport() *StdioTransport
|
||||
|
||||
func (t *StdIOTransport) Connect(context.Context) (Connection, error)
|
||||
func (t *StdioTransport) Connect(context.Context) (Connection, error)
|
||||
```
|
||||
|
||||
#### HTTP transports
|
||||
|
|
@ -378,7 +378,7 @@ A server that can handle that client call would look like this:
|
|||
server := mcp.NewServer("greeter", "v1.0.0", nil)
|
||||
server.AddTools(mcp.NewServerTool("greet", "say hi", SayHi))
|
||||
// Run the server over stdin/stdout, until the client disconnects.
|
||||
transport := mcp.NewStdIOTransport()
|
||||
transport := mcp.NewStdioTransport()
|
||||
session, err := server.Connect(ctx, transport)
|
||||
...
|
||||
return session.Wait()
|
||||
|
|
|
|||
Loading…
Reference in a new issue