Merge pull request #1024 from unistack-org/server

add server Context option to pass own context
This commit is contained in:
Asim Aslam
2019-12-17 08:48:39 +00:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -126,18 +126,21 @@ func Context(ctx context.Context) Option {
}
}
// Registry used for discovery
func Registry(r registry.Registry) Option {
return func(o *Options) {
o.Registry = r
}
}
// Register the service with a TTL
func RegisterTTL(t time.Duration) Option {
return func(o *Options) {
o.RegisterTTL = t
}
}
// Register the service with at interval
func RegisterInterval(t time.Duration) Option {
return func(o *Options) {
o.RegisterInterval = t