internal/mcp: reinstate ClientSession
Add a logical client session type back to the SDK, to bring it closer to the design. Also, remove 'ConnectionOptions', which is better implemented using middleware, and reimplement logging as a LoggingTransport middleware, which is also added to the design. Change-Id: I908b4f837d513ffc60ae5b6171a31519cffafebc Reviewed-on: https://go-review.googlesource.com/c/tools/+/672795 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
parent
0c7d8180a6
commit
a8b98da480
1 changed files with 227 additions and 196 deletions
|
|
@ -50,8 +50,8 @@ func main() {
|
|||
})
|
||||
http.ListenAndServe(*httpAddr, handler)
|
||||
} else {
|
||||
opts := &mcp.ConnectionOptions{Logger: os.Stderr}
|
||||
if err := server.Run(context.Background(), mcp.NewStdIOTransport(), opts); err != nil {
|
||||
t := mcp.NewLoggingTransport(mcp.NewStdIOTransport(), os.Stderr)
|
||||
if err := server.Run(context.Background(), t); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Server failed: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue