Add proxy/router

This commit is contained in:
Asim Aslam
2019-07-31 15:30:51 +01:00
parent fca89e06ef
commit 3e90d32f29
2 changed files with 25 additions and 0 deletions

View File

@@ -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
}
}