Move RegisterInterval into the server

This commit is contained in:
Asim Aslam
2019-01-24 13:22:17 +00:00
parent 8090f9968d
commit 539b8c1a3b
6 changed files with 74 additions and 98 deletions

View File

@@ -27,6 +27,8 @@ type Options struct {
// The register expiry time
RegisterTTL time.Duration
// The interval on which to register
RegisterInterval time.Duration
// The router for requests
Router Router
@@ -168,6 +170,13 @@ func RegisterTTL(t time.Duration) Option {
}
}
// Register the service with at interval
func RegisterInterval(t time.Duration) Option {
return func(o *Options) {
o.RegisterInterval = t
}
}
// WithRouter sets the request router
func WithRouter(r Router) Option {
return func(o *Options) {