MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / Del

Method Del

internal/repository/cache/post.go:178–189  ·  view source on GitHub ↗

Del 删除帖子缓存

(ctx context.Context, key string)

Source from the content-addressed store, hash-verified

176
177// Del 删除帖子缓存
178func (c *postCache) Del(ctx context.Context, key string) error {
179 if key == "" {
180 return fmt.Errorf("无效的帖子ID: %s", key)
181 }
182
183 pipe := c.client.Pipeline()
184 pipe.Del(ctx, c.key(key))
185 pipe.Del(ctx, c.emptyKey(key))
186 pipe.Del(ctx, c.pubKey(key))
187 _, err := pipe.Exec(ctx)
188 return err
189}
190
191// GetList 获取帖子列表缓存
192func (c *postCache) GetList(ctx context.Context, page int, size int) ([]domain.Post, error) {

Callers

nothing calls this directly

Calls 5

keyMethod · 0.95
emptyKeyMethod · 0.95
pubKeyMethod · 0.95
DelMethod · 0.65
ExecMethod · 0.65

Tested by

no test coverage detected