feat(cache): enhance inproc cache

master
Xeronith 2022-09-29 20:47:15 +03:30
rodzic caddf18315
commit d33df3d527
2 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -33,3 +33,10 @@ func (cache *inproc) Get(key string) interface{} {
return nil
}
func (cache *inproc) Remove(key string) {
cache.Lock()
defer cache.Unlock()
delete(cache.collection, key)
}

Wyświetl plik

@ -6,5 +6,6 @@ type (
ICache interface {
Put(string, interface{})
Get(string) interface{}
Remove(string)
}
)