diff --git a/store/options.go b/store/options.go index 3fa6c79d..f8360e41 100644 --- a/store/options.go +++ b/store/options.go @@ -34,6 +34,8 @@ type Options struct { Addrs []string // Wrappers store wrapper that called before actual functions // Wrappers []Wrapper + // Timeout specifies timeout duration for all operations + Timeout time.Duration } // NewOptions creates options struct @@ -110,6 +112,13 @@ func Tracer(t tracer.Tracer) Option { } } +// Timeout sets the timeout +func Timeout(td time.Duration) Option { + return func(o *Options) { + o.Timeout = td + } +} + // Addrs contains the addresses or other connection information of the backing storage. // For example, an etcd implementation would contain the nodes of the cluster. // A SQL implementation could contain one or more connection strings.