gosora/cache.go
Azareal af09013a25 Refactored query_gen into a library.
Moved topic store and user store into their own files.
Tweaked topic store to stop it accessing globals.
2017-06-13 08:12:58 +01:00

24 lines
592 B
Go

package main
import "errors"
const CACHE_STATIC int = 0
const CACHE_DYNAMIC int = 1
const CACHE_SQL int = 2
var ErrStoreCapacityOverflow = errors.New("This datastore has already reached it's max capacity")
type DataStore interface {
Load(id int) error
Get(id int) (interface{}, error)
GetUnsafe(id int) (interface{}, error)
CascadeGet(id int) (interface{}, error)
BypassGet(id int) (interface{}, error)
Set(item interface{}) error
Add(item interface{}) error
AddUnsafe(item interface{}) error
Remove(id int) error
RemoveUnsafe(id int) error
GetLength() int
GetCapacity() int
}