Files

20 lines
529 B
Go
Raw Permalink Normal View History

2018-04-25 13:16:36 +02:00
package contract
import "time"
// CacheManager defines the main caching interface
// - Get methods can return domain.ErrCacheMiss
type CacheManager interface {
GetItem(key string) ([]byte, error)
SetItem(key string, data []byte) error
GetString(key string) (string, error)
SetString(key string, data string) error
GetStruct(key string, data interface{}) error
SetStruct(key string, data interface{}) error
GetExpiration(key string) (time.Duration, error)
SetExpiration(key string, expiration time.Duration) error
}