Key generates a pair of keys to be passed into Postgres advisory lock functions like `pg_advisory_xact_lock`.
()
| 34 | // Key generates a pair of keys to be passed into Postgres advisory lock |
| 35 | // functions like `pg_advisory_xact_lock`. |
| 36 | func (h *AdvisoryLockHash) Key() int64 { |
| 37 | if h.configuredPrefix == 0 { |
| 38 | // Overflow is okay and allowed. |
| 39 | return int64(h.hash64.Sum64()) //nolint:gosec |
| 40 | } |
| 41 | |
| 42 | // Overflow is okay and allowed. |
| 43 | return int64(uint64(h.configuredPrefix)<<32 | uint64(h.hash32.Sum32())) //nolint:gosec |
| 44 | } |
| 45 | |
| 46 | // Write writes bytes to the underlying hash. |
| 47 | func (h *AdvisoryLockHash) Write(data []byte) { |
no outgoing calls