Add proxy/router
This commit is contained in:
@@ -2,6 +2,8 @@ package network
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/client"
|
||||
"github.com/micro/go-micro/network/proxy"
|
||||
"github.com/micro/go-micro/network/router"
|
||||
"github.com/micro/go-micro/server"
|
||||
)
|
||||
|
||||
@@ -11,6 +13,8 @@ type Options struct {
|
||||
Name string
|
||||
Client client.Client
|
||||
Server server.Server
|
||||
Proxy proxy.Proxy
|
||||
Router router.Router
|
||||
}
|
||||
|
||||
// The network name
|
||||
@@ -33,3 +37,19 @@ func Server(s server.Server) Option {
|
||||
o.Server = s
|
||||
}
|
||||
}
|
||||
|
||||
// The proxy to use
|
||||
func Proxy(p proxy.Proxy) Option {
|
||||
return func(o *Options) {
|
||||
o.Proxy = p
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// The router to use
|
||||
func Router(r router.Router) Option {
|
||||
return func(o *Options) {
|
||||
o.Router = r
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user