Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ENV_MEMCACHED_ADDRESS = os.Getenv("ENV_MEMCACHED_ADDRESS")
View Source
var ENV_REDIS_ADDRESS = os.Getenv("ENV_REDIS_ADDRESS")
Functions ¶
This section is empty.
Types ¶
type MemcachedService ¶
func NewMemcachedService ¶
func NewMemcachedService() *MemcachedService
func (*MemcachedService) Acquire ¶
Acquire a distributed lock in Memcached
Parameters:
- lock (*lib.Lock): // Unique lock struct
Returns:
- *lib.Lock: // Pointer to the Lock struct
- error: // Any errors that occured acquiring the lock
func (*MemcachedService) NewLock ¶ added in v0.0.2
func (ms *MemcachedService) NewLock(id string) *lib.Lock
NewLock: Generate a new Lock struct
Parameters:
- id (string): // Lock Identifier MUST be unique to avoid lock collisions
Returns:
- *lib.Lock: // Pointer to the generated Lock struct to allow for customisation.
type RedisService ¶
type RedisService struct {
// contains filtered or unexported fields
}
RedisService:
// A service for creating distributed locks in Redis
func NewRedisService ¶
func NewRedisService() *RedisService
NewRedisService:
Creates a new Redis Service to allow redis locks.
Returns:
*RedisService
func (*RedisService) Acquire ¶
Acquire a distributed lock in Redis
Parameters:
- lock (*lib.Lock): // Unique lock struct
Returns:
- *lib.Lock: // Pointer to the Lock struct
- error: // Any errors that occured acquiring the lock
func (*RedisService) NewLock ¶ added in v0.0.2
func (ms *RedisService) NewLock(id string) *lib.Lock
NewLock: Generate a new Lock struct
Parameters:
- id (string): Lock Identifier MUST be unique to avoid lock collisions
Returns:
- *lib.Lock: Pointer to the generated Lock struct to allow for customisation.
Click to show internal directories.
Click to hide internal directories.