mcp: remove deprecated transport constructors
In #272, we made transports open structs and deprecated their constructors. However, we left the constructors in place to allow go:fix directives to facilitate migration. Now let's remove the constructors before cutting the release. Fixes #305
This commit is contained in:
parent
5bbca40032
commit
b1c75f04d8
1 changed files with 1 additions and 124 deletions
37
mcp/sse.go
37
mcp/sse.go
|
|
@ -114,19 +114,6 @@ type SSEServerTransport struct {
|
|||
done chan struct{} // closed when the connection is closed
|
||||
}
|
||||
|
||||
// NewSSEServerTransport creates a new SSE transport for the given messages
|
||||
// endpoint, and hanging GET response.
|
||||
//
|
||||
// Deprecated: use an SSEServerTransport literal.
|
||||
//
|
||||
//go:fix inline
|
||||
func NewSSEServerTransport(endpoint string, w http.ResponseWriter) *SSEServerTransport {
|
||||
return &SSEServerTransport{
|
||||
Endpoint: endpoint,
|
||||
Response: w,
|
||||
}
|
||||
}
|
||||
|
||||
// ServeHTTP handles POST requests to the transport endpoint.
|
||||
func (t *SSEServerTransport) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
if t.incoming == nil {
|
||||
|
|
@ -334,30 +321,6 @@ type SSEClientTransport struct {
|
|||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// SSEClientTransportOptions provides options for the [NewSSEClientTransport]
|
||||
// constructor.
|
||||
//
|
||||
// Deprecated: use an SSEClientTransport literal.
|
||||
type SSEClientTransportOptions struct {
|
||||
// HTTPClient is the client to use for making HTTP requests. If nil,
|
||||
// http.DefaultClient is used.
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// NewSSEClientTransport returns a new client transport that connects to the
|
||||
// SSE server at the provided URL.
|
||||
//
|
||||
// Deprecated: use an SSEClientTransport literal.
|
||||
//
|
||||
//go:fix inline
|
||||
func NewSSEClientTransport(endpoint string, opts *SSEClientTransportOptions) *SSEClientTransport {
|
||||
t := &SSEClientTransport{Endpoint: endpoint}
|
||||
if opts != nil {
|
||||
t.HTTPClient = opts.HTTPClient
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
// Connect connects through the client endpoint.
|
||||
func (c *SSEClientTransport) Connect(ctx context.Context) (Connection, error) {
|
||||
parsedURL, err := url.Parse(c.Endpoint)
|
||||
|
|
|
|||
Loading…
Reference in a new issue