Add router advertisement Strategy option to router.

This commit is contained in:
Milos Gajdos
2019-10-09 16:03:06 +01:00
parent fe94237448
commit 96e564e402
3 changed files with 26 additions and 14 deletions

View File

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