initial commit 2
This commit is contained in:
19
domain/contract/cache.go
Normal file
19
domain/contract/cache.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user