MCPcopy Index your code
hub / github.com/riverqueue/river / Key

Method Key

rivershared/util/hashutil/hash_util.go:36–44  ·  view source on GitHub ↗

Key generates a pair of keys to be passed into Postgres advisory lock functions like `pg_advisory_xact_lock`.

()

Source from the content-addressed store, hash-verified

34// Key generates a pair of keys to be passed into Postgres advisory lock
35// functions like `pg_advisory_xact_lock`.
36func (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.
47func (h *AdvisoryLockHash) Write(data []byte) {

Callers 2

TestAdvisoryLockHashFunction · 0.95
exerciseExecutorTxFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestAdvisoryLockHashFunction · 0.76