MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / Set

Method Set

internal/cache/userExample.go:70–80  ·  view source on GitHub ↗

Set write to cache

(ctx context.Context, id uint64, data *model.UserExample, duration time.Duration)

Source from the content-addressed store, hash-verified

68
69// Set write to cache
70func (c *userExampleCache) Set(ctx context.Context, id uint64, data *model.UserExample, duration time.Duration) error {
71 if data == nil || id == 0 {
72 return nil
73 }
74 cacheKey := c.GetUserExampleCacheKey(id)
75 err := c.cache.Set(ctx, cacheKey, data, duration)
76 if err != nil {
77 return err
78 }
79 return nil
80}
81
82// Get cache value
83func (c *userExampleCache) Get(ctx context.Context, id uint64) (*model.UserExample, error) {

Callers

nothing calls this directly

Calls 2

SetMethod · 0.65

Tested by

no test coverage detected