MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / ComputeVersionedHash

Function ComputeVersionedHash

pkg/utils/hash/hash.go:62–69  ·  view source on GitHub ↗

ComputeVersionedHash follows the same rules of ComputeHash with the exception that accepts also a epoc value. The epoc value is used to generate a new hash from a same object. This is useful to force a new hash even if the original object is not changed. A practical use is to force a reconciliation

(object interface{}, epoc int)

Source from the content-addressed store, hash-verified

60// This is useful to force a new hash even if the original object is not changed.
61// A practical use is to force a reconciliation loop of the object.
62func ComputeVersionedHash(object interface{}, epoc int) (string, error) {
63 type versionedHash struct {
64 object interface{}
65 epoc int
66 }
67
68 return ComputeHash(versionedHash{object: object, epoc: epoc})
69}

Callers 3

services_test.goFile · 0.92
ServiceFunction · 0.92
hash_test.goFile · 0.85

Calls 1

ComputeHashFunction · 0.85

Tested by

no test coverage detected