Add router advertisement Strategy option to router.
This commit is contained in:
@@ -18,6 +18,8 @@ type Options struct {
|
||||
Network string
|
||||
// Registry is the local registry
|
||||
Registry registry.Registry
|
||||
// Advertise is the advertising strategy
|
||||
Advertise Strategy
|
||||
// Client for calling router
|
||||
Client client.Client
|
||||
}
|
||||
@@ -64,6 +66,13 @@ func Registry(r registry.Registry) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Strategy sets route advertising strategy
|
||||
func Advertise(a Strategy) Option {
|
||||
return func(o *Options) {
|
||||
o.Advertise = a
|
||||
}
|
||||
}
|
||||
|
||||
// DefaultOptions returns router default options
|
||||
func DefaultOptions() Options {
|
||||
return Options{
|
||||
|
||||
Reference in New Issue
Block a user