1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

add address/advertise

This commit is contained in:
Asim Aslam
2019-07-31 15:35:51 +01:00
parent 3e90d32f29
commit 2d09e74b0e
3 changed files with 34 additions and 12 deletions

View File

@ -10,11 +10,16 @@ import (
type Option func(*Options)
type Options struct {
Name string
Client client.Client
Server server.Server
Proxy proxy.Proxy
Router router.Router
// Name of the network
Name string
// Address of the node
Address string
// Advertise a different address to the network
Advertise string
Client client.Client
Server server.Server
Proxy proxy.Proxy
Router router.Router
}
// The network name
@ -24,6 +29,20 @@ func Name(n string) Option {
}
}
// The network address
func Address(a string) Option {
return func(o *Options) {
o.Address = a
}
}
// The network advertise address
func Advertise(a string) Option {
return func(o *Options) {
o.Advertise = a
}
}
// The network client
func Client(c client.Client) Option {
return func(o *Options) {