This commit is contained in:
Asim
2016-01-26 23:32:27 +00:00
parent ce0c5908a6
commit 5ec9d561a6
8 changed files with 142 additions and 25 deletions

View File

@@ -17,6 +17,13 @@ type Options struct {
Context context.Context
}
type RegisterOptions struct {
TTL time.Duration
// Other options for implementations of the interface
// can be stored in a context
Context context.Context
}
func Timeout(t time.Duration) Option {
return func(o *Options) {
o.Timeout = t
@@ -36,3 +43,9 @@ func TLSConfig(t *tls.Config) Option {
o.TLSConfig = t
}
}
func WithTTL(t time.Duration) RegisterOption {
return func(o *RegisterOptions) {
o.TTL = t
}
}