Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker struct { Logger locker.Logger Hash32A func() hash.Hash32 Hash32B func() hash.Hash32 // contains filtered or unexported fields }
Locker is an implementation of the locker.Locker using PostgreSQL pg_advisory_lock
func (*Locker) Get ¶
Get calls PostgreSQL pg_advisory_lock(keyA int, keyB int) to acquire the lock. Since these pg_advisory_lock keys are 32-bit integers, this method uses two different hash functions to convert the argument string keys to integers and uses them as the keys for pg_advisory_lock. Default hash functions are FNV-1a hash and Murmur hash.
Click to show internal directories.
Click to hide internal directories.