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

Method Set

api/pkg/cache/redis_cache.go:44–53  ·  view source on GitHub ↗

Set an item in the redis cache

(ctx context.Context, key string, value string, ttl time.Duration)

Source from the content-addressed store, hash-verified

42
43// Set an item in the redis cache
44func (cache *redisCache) Set(ctx context.Context, key string, value string, ttl time.Duration) error {
45 ctx, span := cache.tracer.Start(ctx)
46 defer span.End()
47
48 err := cache.client.Set(ctx, key, value, ttl).Err()
49 if err != nil {
50 return cache.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, "cannot set item in redis"))
51 }
52 return nil
53}

Callers

nothing calls this directly

Calls 3

StartMethod · 0.65
SetMethod · 0.65
WrapErrorSpanMethod · 0.65

Tested by

no test coverage detected