Documentation ¶
Index ¶
- Constants
- Variables
- func GenMutexKey(object *types.Object) string
- func GenMutexKeyForRestore(freezer *types.Freezer) string
- func HashSum(ObjectName string) (string, error)
- func Initialize()
- func InitializeCluster() interface{}
- func InitializeSingle() interface{}
- func RemoveLock(key string)
- type ClusterRedis
- func (c *ClusterRedis) Check()
- func (c *ClusterRedis) Close()
- func (c *ClusterRedis) Get(table RedisDatabase, key string, unmarshal func([]byte) (interface{}, error)) (value interface{}, err error)
- func (c *ClusterRedis) GetBytes(key string, start int64, end int64) ([]byte, error)
- func (c *ClusterRedis) GetUsage(key string) (value string, err error)
- func (c *ClusterRedis) Invalid(table RedisDatabase, key string) (err error)
- func (c *ClusterRedis) Remove(table RedisDatabase, key string) error
- func (c *ClusterRedis) RemoveLock(key string)
- func (c *ClusterRedis) Set(table RedisDatabase, key string, value interface{}) error
- func (c *ClusterRedis) SetBytes(key string, value []byte) (err error)
- type Redis
- type RedisDatabase
- type SingleRedis
- func (s *SingleRedis) Check()
- func (s *SingleRedis) Close()
- func (s *SingleRedis) Get(table RedisDatabase, key string, unmarshal func([]byte) (interface{}, error)) (value interface{}, err error)
- func (s *SingleRedis) GetBytes(key string, start int64, end int64) ([]byte, error)
- func (s *SingleRedis) GetUsage(key string) (value string, err error)
- func (s *SingleRedis) Invalid(table RedisDatabase, key string) (err error)
- func (s *SingleRedis) Remove(table RedisDatabase, key string) error
- func (s *SingleRedis) RemoveLock(key string)
- func (s *SingleRedis) Set(table RedisDatabase, key string, value interface{}) error
- func (s *SingleRedis) SetBytes(key string, value []byte) (err error)
Constants ¶
View Source
const ( InvalidQueueName = "InvalidQueue" RESTOREINFO = "Restore:" )
Variables ¶
View Source
var DataTables = []RedisDatabase{FileTable}
View Source
var Locker *redislock.Client
View Source
var MetadataTables = []RedisDatabase{UserTable, BucketTable, ObjectTable, ClusterTable}
View Source
var RedisClient redislock.RedisClient
Functions ¶
func GenMutexKey ¶
func GenMutexKeyForRestore ¶
func Initialize ¶
func Initialize()
func InitializeCluster ¶
func InitializeCluster() interface{}
func InitializeSingle ¶
func InitializeSingle() interface{}
func RemoveLock ¶
func RemoveLock(key string)
Types ¶
type ClusterRedis ¶
type ClusterRedis struct {
// contains filtered or unexported fields
}
func (*ClusterRedis) Check ¶
func (c *ClusterRedis) Check()
func (*ClusterRedis) Close ¶
func (c *ClusterRedis) Close()
func (*ClusterRedis) Get ¶
func (c *ClusterRedis) Get(table RedisDatabase, key string, unmarshal func([]byte) (interface{}, error)) (value interface{}, err error)
func (*ClusterRedis) GetUsage ¶
func (c *ClusterRedis) GetUsage(key string) (value string, err error)
func (*ClusterRedis) Invalid ¶
func (c *ClusterRedis) Invalid(table RedisDatabase, key string) (err error)
func (*ClusterRedis) Remove ¶
func (c *ClusterRedis) Remove(table RedisDatabase, key string) error
func (*ClusterRedis) RemoveLock ¶
func (c *ClusterRedis) RemoveLock(key string)
func (*ClusterRedis) Set ¶
func (c *ClusterRedis) Set(table RedisDatabase, key string, value interface{}) error
type Redis ¶
type Redis interface { Close() Set(table RedisDatabase, key string, value interface{}) error Get(table RedisDatabase, key string, unmarshal func([]byte) (interface{}, error)) (interface{}, error) Remove(table RedisDatabase, key string) error RemoveLock(key string) // Get Usages // `start` and `end` are inclusive GetUsage(key string) (string, error) // Set file bytes SetBytes(key string, value []byte) (err error) // Get file bytes // `start` and `end` are inclusive // FIXME: this API causes an extra memory copy, need to patch radix to fix it GetBytes(key string, start int64, end int64) ([]byte, error) // Publish the invalid message to other YIG instances through Redis Invalid(table RedisDatabase, key string) (err error) Check() }
var RedisConn Redis
type RedisDatabase ¶
type RedisDatabase int
const ( UserTable RedisDatabase = iota BucketTable ObjectTable FileTable ClusterTable )
func (RedisDatabase) InvalidQueue ¶
func (r RedisDatabase) InvalidQueue() string
func (RedisDatabase) String ¶
func (r RedisDatabase) String() string
type SingleRedis ¶
type SingleRedis struct {
// contains filtered or unexported fields
}
func (*SingleRedis) Check ¶
func (s *SingleRedis) Check()
func (*SingleRedis) Close ¶
func (s *SingleRedis) Close()
func (*SingleRedis) Get ¶
func (s *SingleRedis) Get(table RedisDatabase, key string, unmarshal func([]byte) (interface{}, error)) (value interface{}, err error)
func (*SingleRedis) Invalid ¶
func (s *SingleRedis) Invalid(table RedisDatabase, key string) (err error)
func (*SingleRedis) Remove ¶
func (s *SingleRedis) Remove(table RedisDatabase, key string) error
func (*SingleRedis) RemoveLock ¶
func (s *SingleRedis) RemoveLock(key string)
func (*SingleRedis) Set ¶
func (s *SingleRedis) Set(table RedisDatabase, key string, value interface{}) error
Click to show internal directories.
Click to hide internal directories.