MCPcopy Index your code
hub / github.com/NdoleStudio/httpsms / Get

Method Get

api/pkg/cache/memory_cache.go:28–38  ·  view source on GitHub ↗

Get an item from the redis cache

(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

26
27// Get an item from the redis cache
28func (cache *memoryCache) Get(ctx context.Context, key string) (value string, err error) {
29 ctx, span := cache.tracer.Start(ctx)
30 defer span.End()
31
32 response, ok := cache.store.Get(key)
33 if !ok {
34 return "", stacktrace.NewError(fmt.Sprintf("no item found in cache with key [%s]", key))
35 }
36
37 return response.(string), nil
38}
39
40// Set an item in the redis cache
41func (cache *memoryCache) Set(ctx context.Context, key string, value string, ttl time.Duration) error {

Callers

nothing calls this directly

Calls 2

StartMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected