Fixup the proxy, strip down go.mod. Win bigly
This commit is contained in:
@@ -4,6 +4,7 @@ package proxy
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/micro/go-micro/client"
|
||||
"github.com/micro/go-micro/options"
|
||||
"github.com/micro/go-micro/server"
|
||||
)
|
||||
@@ -11,6 +12,20 @@ import (
|
||||
// Proxy can be used as a proxy server for go-micro services
|
||||
type Proxy interface {
|
||||
options.Options
|
||||
// ServeRequest will serve a request
|
||||
// ServeRequest honours the server.Router interface
|
||||
ServeRequest(context.Context, server.Request, server.Response) error
|
||||
}
|
||||
|
||||
var (
|
||||
DefaultEndpoint = "localhost:9090"
|
||||
)
|
||||
|
||||
// WithEndpoint sets a proxy endpoint
|
||||
func WithEndpoint(e string) options.Option {
|
||||
return options.WithValue("proxy.endpoint", e)
|
||||
}
|
||||
|
||||
// WithClient sets the client
|
||||
func WithClient(c client.Client) options.Option {
|
||||
return options.WithValue("proxy.client", c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user