MCPcopy
hub / github.com/grafana/dskit / NewVersioned

Function NewVersioned

cache/versioned.go:24–30  ·  view source on GitHub ↗

NewVersioned creates a new Versioned cache.

(c Cache, version uint, logger log.Logger)

Source from the content-addressed store, hash-verified

22
23// NewVersioned creates a new Versioned cache.
24func NewVersioned(c Cache, version uint, logger log.Logger) *Versioned {
25 return &Versioned{
26 cache: c,
27 logger: logger,
28 versionPrefix: fmt.Sprintf("%d@", version),
29 }
30}
31
32func (c *Versioned) SetAsync(key string, value []byte, ttl time.Duration) {
33 c.cache.SetAsync(c.addVersion(key), value, ttl)

Callers 1

TestVersionedFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestVersionedFunction · 0.68