forked from fiatjaf/njump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnull_cache.go
27 lines (21 loc) · 1.01 KB
/
null_cache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//go:build nocache
package main
import (
"time"
"github.com/fiatjaf/eventstore"
"github.com/fiatjaf/eventstore/nullstore"
)
var (
cache = Cache{}
db eventstore.Store = &nullstore.NullStore{}
)
type Cache struct{}
func (c *Cache) initialize() func() { return func() {} }
func (c *Cache) Get(key string) ([]byte, bool) { return nil, false }
func (c *Cache) GetJSON(key string, recv any) bool { return false }
func (c *Cache) Set(key string, value []byte) {}
func (c *Cache) SetJSON(key string, value any) {}
func (c *Cache) SetWithTTL(key string, value []byte, ttl time.Duration) {}
func (c *Cache) SetJSONWithTTL(key string, value any, ttl time.Duration) {}
func (c *Cache) GetPaginatedKeys(prefix string, page int, size int) []string { return []string{} }
func (c *Cache) Delete(key string) {}