Documentation
¶
Index ¶
- Constants
- func New(client *api.Client, opts ...widelock.OptionSet) (widelock.MutexSet, error)
- func WithDeleteKey() widelock.OptionSet
- func WithDuration(d time.Duration) widelock.Option
- func WithExpiry(e time.Time) widelock.Option
- func WithKeyPrefix(prefix string) widelock.OptionSet
- func WithLostNotify(ch chan<- struct{}) widelock.Option
- type Set
Constants ¶
View Source
const DefaultKeyPrefix = "widelock/"
Variables ¶
This section is empty.
Functions ¶
func WithDeleteKey ¶
WithDeleteKey create a Set option to specify behavior to delete key of unlocked locker and all keys in Set after closed. This would slightly increase load of unlock, but if the locker would be used only once in most cases, enable this is helpful to reduce memory usage of Consul server.
func WithDuration ¶
WithDuration set duration for sustaining the lock. It start from lock really obtained.
func WithExpiry ¶
WithExpiry set expiry for lock. It would be covered by duration if set.
func WithKeyPrefix ¶
WithKeyPrefix create a Set option to set the prefix of key of Consul. Default is `widelock:`
func WithLostNotify ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.