MCPcopy Index your code
hub / github.com/coder/coder / fingerprintLabelPairs

Function fingerprintLabelPairs

coderd/notifications/metrics_test.go:465–472  ·  view source on GitHub ↗

fingerprintLabelPairs produces a fingerprint unique to the given combination of label pairs.

(lbs []*dto.LabelPair)

Source from the content-addressed store, hash-verified

463
464// fingerprintLabelPairs produces a fingerprint unique to the given combination of label pairs.
465func fingerprintLabelPairs(lbs []*dto.LabelPair) model.Fingerprint {
466 pairs := make([]string, 0, len(lbs)*2)
467 for _, lp := range lbs {
468 pairs = append(pairs, lp.GetName(), lp.GetValue())
469 }
470
471 return fingerprintLabels(pairs...)
472}
473
474// fingerprintLabels produces a fingerprint unique to the given pairs of label values.
475// MUST contain an even number of arguments (key:value), otherwise it will panic.

Callers 1

hasMatchingFingerprintFunction · 0.85

Calls 3

fingerprintLabelsFunction · 0.85
GetNameMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected