MCPcopy Create free account
hub / github.com/pace/bricks / Put

Method Put

pkg/cache/cache.go:15–15  ·  view source on GitHub ↗

Put stores the value under the key. Any existing value is overwritten. If ttl is given, the cache automatically forgets the value after the duration. If ttl is zero then it is never automatically forgotten.

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

Source from the content-addressed store, hash-verified

13 // ttl is given, the cache automatically forgets the value after the
14 // duration. If ttl is zero then it is never automatically forgotten.
15 Put(ctx context.Context, key string, value []byte, ttl time.Duration) error
16
17 // Get returns the value stored under the key and its remaining ttl. If
18 // there is no value stored, ErrNotFound is returned. If the ttl is zero,

Callers 5

Example_inMemoryFunction · 0.95
HealthCheckMethod · 0.65
TestPutMethod · 0.65
TestGetMethod · 0.65
TestForgetMethod · 0.65

Implementers 2

Redispkg/cache/redis.go
Memorypkg/cache/memory.go

Calls

no outgoing calls

Tested by 1

Example_inMemoryFunction · 0.76