MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / Set

Method Set

internal/cache/cacheNameExample.go:68–71  ·  view source on GitHub ↗

Set cache

(ctx context.Context, keyNameExample keyTypeExample, valueNameExample valueTypeExample, duration time.Duration)

Source from the content-addressed store, hash-verified

66
67// Set cache
68func (c *cacheNameExampleCache) Set(ctx context.Context, keyNameExample keyTypeExample, valueNameExample valueTypeExample, duration time.Duration) error {
69 cacheKey := c.getCacheKey(keyNameExample)
70 return c.cache.Set(ctx, cacheKey, &valueNameExample, duration)
71}
72
73// Get cache
74func (c *cacheNameExampleCache) Get(ctx context.Context, keyNameExample keyTypeExample) (valueTypeExample, error) {

Callers

nothing calls this directly

Calls 2

getCacheKeyMethod · 0.95
SetMethod · 0.65

Tested by

no test coverage detected