Documentation ¶
Index ¶
- Constants
- func GetRunDir() (string, error)
- type Cache
- type Configrsmemory
- type HashSlotCalculator
- type InProcessCache
- type LastUpdatedDictionary
- type NewInput
- type RedisMultilevelCache
- type Service
- func (s *Service) Do(comman string, args ...interface{}) (reply interface{}, err error)
- func (s *Service) Get(key string) (reply string, err error)
- func (s *Service) GetCacheFromRedis(key string) (data Cache, err error)
- func (s *Service) Publish(key string, value string) error
- func (s *Service) SaveCacheToRedis(key string, data Cache)
- func (s *Service) ScriptEvaluate(luaScript string, num_args int, args ...interface{}) (reply interface{}, err error)
- func (s *Service) Set(key string, value string) (reply interface{}, err error)
- func (s *Service) Subscribe(key string, msg chan []byte) error
Constants ¶
View Source
const ( SYNC_CHANNEL_NAME string = "RedisMultilevelCache_Sync" READ_FROM_MEMORY string = "READ_FROM_MEMORY" READ_FROM_REDIS string = "READ_FROM_REDIS" OUTDATE_READ_FROM_REDIS string = "OUTDATE_READ_FROM_REDIS" READ_DEFAULT string = "READ_DEFAULT" DEFAULT_REDIS_URI string = "localhost:6379" )
View Source
const (
HASH_SLOT_COUNT = 16384 //Inspired by Redis cluster hash slot implementation
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configrsmemory ¶
type HashSlotCalculator ¶
type HashSlotCalculator interface { CalculateHashSlot(key string) uint16 // contains filtered or unexported methods }
func NewHashSlotCalculator ¶
func NewHashSlotCalculator(slot uint16) HashSlotCalculator
type InProcessCache ¶
type LastUpdatedDictionary ¶
type LastUpdatedDictionary interface { Get(key uint16) int64 Set(key uint16, data int64) // contains filtered or unexported methods }
func NewLastUpdatedDictionary ¶
func NewLastUpdatedDictionary() LastUpdatedDictionary
type RedisMultilevelCache ¶
type RedisMultilevelCache interface { Get(key string) (interface{}, string) Set(key string, data interface{}) GetRedisService() *Service Size() int // contains filtered or unexported methods }
func NewRedisMultilevelCache ¶
func NewRedisMultilevelCache(config *Configrsmemory) RedisMultilevelCache
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
service redis
func (*Service) GetCacheFromRedis ¶
func (*Service) SaveCacheToRedis ¶
func (*Service) ScriptEvaluate ¶
func (s *Service) ScriptEvaluate(luaScript string, num_args int, args ...interface{}) (reply interface{}, err error)
var luaScript = @"
local result={} result[1] = redis.call('GET', KEYS[1]) result[2] = redis.call('TTL', KEYS[1]) return result;
";
Click to show internal directories.
Click to hide internal directories.