diff --git a/sync/options.go b/sync/options.go index 81d6e256..8e356c24 100644 --- a/sync/options.go +++ b/sync/options.go @@ -1,6 +1,7 @@ package sync import ( + "context" "crypto/tls" "time" ) @@ -39,3 +40,10 @@ func WithTLS(t *tls.Config) Option { o.TLSConfig = t } } + +// WithContext sets the syncs context, for any extra configuration +func WithContext(c context.Context) Option { + return func(o *Options) { + o.Context = c + } +} diff --git a/sync/sync.go b/sync/sync.go index 38b3a7d9..62f842ed 100644 --- a/sync/sync.go +++ b/sync/sync.go @@ -2,6 +2,7 @@ package sync import ( + "context" "crypto/tls" "errors" "time" @@ -39,6 +40,7 @@ type Options struct { Nodes []string Prefix string TLSConfig *tls.Config + Context context.Context } type Option func(o *Options)