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

Method Get

internal/cache/cache.go:139–146  ·  view source on GitHub ↗

Get retrieves an entry from the cache based on the provided key. Parameters: - ctx: The context for the operation. - key: The cache key to retrieve. - data: The variable to store the retrieved data. Returns an error if the key does not exist or if the retrieval fails.

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

Source from the content-addressed store, hash-verified

137// - data: The variable to store the retrieved data.
138// Returns an error if the key does not exist or if the retrieval fails.
139func (r *RedisCache) Get(ctx context.Context, key string, data interface{}) error {
140 err := r.cache.Get(ctx, key, &data)
141 if errors.Is(err, cache.ErrCacheMiss) {
142 return nil // Return nil if the cache key was not found (cache miss)
143 }
144
145 return err
146}
147
148// Delete removes an entry from the cache based on the provided key.
149// Parameters:

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected