MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / Set

Method Set

internal/cache/cache.go:124–131  ·  view source on GitHub ↗

Set adds a new entry to the cache with a specified key and TTL. Parameters: - ctx: The context for the operation. - key: The cache key under which to store the value. - data: The value to be cached. - ttl: The time-to-live duration for the cached value. Returns an error if the caching operation fail

(ctx context.Context, key string, data interface{}, ttl time.Duration)

Source from the content-addressed store, hash-verified

122// - ttl: The time-to-live duration for the cached value.
123// Returns an error if the caching operation fails.
124func (r *RedisCache) Set(ctx context.Context, key string, data interface{}, ttl time.Duration) error {
125 return r.cache.Set(&cache.Item{
126 Ctx: ctx,
127 Key: key,
128 Value: data,
129 TTL: ttl,
130 })
131}
132
133// Get retrieves an entry from the cache based on the provided key.
134// Parameters:

Callers

nothing calls this directly

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected