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:
@ -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) {
|
||||
|
Reference in New Issue
Block a user