mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-05-14 17:27:10 +02:00
Move to []byte for caching and make it compile
This commit is contained in:
parent
5b6eecc75f
commit
c4181d1206
11 changed files with 63 additions and 43 deletions
8
server/cache/memory.go
vendored
8
server/cache/memory.go
vendored
|
@ -9,16 +9,16 @@ type MCache struct {
|
|||
mcache *mcache.CacheDriver
|
||||
}
|
||||
|
||||
func (m *MCache) Set(key string, value string, ttl time.Duration) error {
|
||||
func (m *MCache) Set(key string, value []byte, ttl time.Duration) error {
|
||||
return m.mcache.Set(key, value, ttl)
|
||||
}
|
||||
|
||||
func (m *MCache) Get(key string) (string, bool) {
|
||||
func (m *MCache) Get(key string) ([]byte, bool) {
|
||||
val, ok := m.mcache.Get(key)
|
||||
if ok {
|
||||
return val.(string), true
|
||||
return val.([]byte), true
|
||||
} else {
|
||||
return "", false
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue