Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMemcachedDriver ¶
func NewMemcachedDriver(client *memcache.Client) (Cache, LockFactory)
func NewRedigoDriver ¶ added in v1.1.0
func NewRedigoDriver(pool *redis.Pool) (Cache, LockFactory)
func NewRedisDriver ¶
func NewRedisDriver(client *redis.Client) (Cache, LockFactory)
Types ¶
type Cache ¶
type Cache interface { // Get returns the value for the specified key if it is present in the cache. Get(ctx context.Context, key string) ([]byte, error) // Set inserts or updates the specified key-value pair with an expiration time. Set(ctx context.Context, key string, value []byte, expiry time.Duration) error }
Cache
type DistributedLock ¶
DistributedLock
type LockFactory ¶
type LockFactory func(key string, duration time.Duration) DistributedLock
LockFactory
func MemcacheLockFactory ¶
func MemcacheLockFactory(cache *memcache.Client) LockFactory
func RedisLockFactory ¶
func RedisLockFactory(locker *redsync.Redsync) LockFactory
type Memcached ¶
type Memcached struct {
// contains filtered or unexported fields
}
type Redigo ¶ added in v1.1.0
type Redigo struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.