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

Function UniqueKey

internal/dbunique/db_unique.go:47–54  ·  view source on GitHub ↗
(timeGen rivertype.TimeGenerator, uniqueOpts *UniqueOpts, params *rivertype.JobInsertParams)

Source from the content-addressed store, hash-verified

45}
46
47func UniqueKey(timeGen rivertype.TimeGenerator, uniqueOpts *UniqueOpts, params *rivertype.JobInsertParams) ([]byte, error) {
48 uniqueKeyString, err := buildUniqueKeyString(timeGen, uniqueOpts, params)
49 if err != nil {
50 return nil, err
51 }
52 uniqueKeyHash := sha256.Sum256([]byte(uniqueKeyString))
53 return uniqueKeyHash[:], nil
54}
55
56// Builds a unique key made up of the unique options in place. The key is hashed
57// to become a value for `unique_key`.

Callers 4

TestPeriodicJobEnqueuerFunction · 0.92
TestUniqueKeyFunction · 0.85

Calls 1

buildUniqueKeyStringFunction · 0.85

Tested by 3

TestPeriodicJobEnqueuerFunction · 0.74
TestUniqueKeyFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…