aboutsummaryrefslogtreecommitdiff
path: root/fetchers/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'fetchers/cache.go')
-rw-r--r--fetchers/cache.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/fetchers/cache.go b/fetchers/cache.go
index 11a43f3..4196792 100644
--- a/fetchers/cache.go
+++ b/fetchers/cache.go
@@ -61,6 +61,16 @@ func (c *Cache) Set(uri string, note *notes.Note) {
c.client.Set(c.ctx, key, data, c.expiryTime)
}
+func (c *Cache) Delete(uri string) {
+ key := fmt.Sprintf("post:%s", uri)
+ c.client.Del(c.ctx, key)
+}
+
+func (c *Cache) DeleteAuthor(did string) {
+ key := fmt.Sprintf("profile:%s", did)
+ c.client.Del(c.ctx, key)
+}
+
func (c *Cache) GetAuthor(did string) (*notes.Author, bool) {
key := fmt.Sprintf("profile:%s", did)
data, err := c.client.Get(c.ctx, key).Bytes()