add router selector and network defaults

This commit is contained in:
Asim Aslam
2019-06-26 16:12:57 +01:00
parent 1a62c11166
commit ac098e4d78
6 changed files with 292 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/config/options"
"github.com/micro/go-micro/network/router"
"github.com/micro/go-micro/server"
)
@@ -29,3 +30,8 @@ func WithEndpoint(e string) options.Option {
func WithClient(c client.Client) options.Option {
return options.WithValue("proxy.client", c)
}
// WithRouter specifies the router to use
func WithRouter(r router.Router) options.Option {
return options.WithValue("proxy.router", r)
}