Documentation ¶
Index ¶
- Constants
- type Cache
- type CacheTime
- type LevelCache
- func (level *LevelCache) Close() error
- func (level *LevelCache) Delete(key string) error
- func (level *LevelCache) DeleteExpired()
- func (level *LevelCache) Get(key string) ([]byte, error)
- func (level *LevelCache) IsCached(key string) bool
- func (level *LevelCache) Write(key string, value []byte, d time.Duration) error
- type NonCache
- type RedisCache
Constants ¶
View Source
const ( DB_LEVEL = "leveldb" DB_REDIS = "redis" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Write(key string, value []byte, duration time.Duration) error Get(key string) ([]byte, error) IsCached(key string) bool Delete(key string) error Close() error DeleteExpired() }
func NewLevelDbCache ¶
func NewNonCache ¶
func NewNonCache() Cache
type LevelCache ¶
type LevelCache struct {
// contains filtered or unexported fields
}
func (*LevelCache) Close ¶
func (level *LevelCache) Close() error
func (*LevelCache) Delete ¶
func (level *LevelCache) Delete(key string) error
func (*LevelCache) DeleteExpired ¶
func (level *LevelCache) DeleteExpired()
func (*LevelCache) IsCached ¶
func (level *LevelCache) IsCached(key string) bool
type NonCache ¶
type NonCache struct{}
func (*NonCache) DeleteExpired ¶
func (non *NonCache) DeleteExpired()
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func (*RedisCache) Close ¶
func (r *RedisCache) Close() error
func (*RedisCache) Delete ¶
func (r *RedisCache) Delete(key string) error
func (*RedisCache) DeleteExpired ¶
func (r *RedisCache) DeleteExpired()
func (*RedisCache) IsCached ¶
func (r *RedisCache) IsCached(key string) bool
Click to show internal directories.
Click to hide internal directories.