package goredislock const DefaultExpireTime = 10 type Options struct { block bool waitTime int expireTime int reNewLock bool } func (o *Options) repair() { if o.expireTime == 0 { o.expireTime = DefaultExpireTime o.reNewLock = true } } type Option func(o *Options) func WithBlock() Option { return func(o *Options) { o.block = true } } func WithWaitTime(waitTime int) Option { return func(o *Options) { o.waitTime = waitTime } } func WithExpireTime(expireTime int) Option { return func(o *Options) { o.expireTime = expireTime } }