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

Method Get

internal/cache/cacheNameExample.go:74–82  ·  view source on GitHub ↗

Get cache

(ctx context.Context, keyNameExample keyTypeExample)

Source from the content-addressed store, hash-verified

72
73// Get cache
74func (c *cacheNameExampleCache) Get(ctx context.Context, keyNameExample keyTypeExample) (valueTypeExample, error) {
75 var valueNameExample valueTypeExample
76 cacheKey := c.getCacheKey(keyNameExample)
77 err := c.cache.Get(ctx, cacheKey, &valueNameExample)
78 if err != nil {
79 return valueNameExample, err
80 }
81 return valueNameExample, nil
82}
83
84// Del delete cache
85func (c *cacheNameExampleCache) Del(ctx context.Context, keyNameExample keyTypeExample) error {

Callers

nothing calls this directly

Calls 2

getCacheKeyMethod · 0.95
GetMethod · 0.65

Tested by

no test coverage detected