Set write to cache
(ctx context.Context, id uint64, data *model.UserExample, duration time.Duration)
| 68 | |
| 69 | // Set write to cache |
| 70 | func (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 |
| 83 | func (c *userExampleCache) Get(ctx context.Context, id uint64) (*model.UserExample, error) { |
nothing calls this directly
no test coverage detected