Documentation
¶
Index ¶
- Constants
- type MongoDBBackend
- func (m *MongoDBBackend) Close() error
- func (m *MongoDBBackend) GetLocks(group string) (int, error)
- func (m *MongoDBBackend) GetStaleLocks(ts time.Duration) ([]types.Lock, error)
- func (m *MongoDBBackend) HasLock(group string, id string) (bool, error)
- func (m *MongoDBBackend) Release(group string, id string) error
- func (m *MongoDBBackend) Reserve(group string, id string) error
- type MongoDBConfig
- type MongoLock
Constants ¶
View Source
const DEFAULT_DATABASE = "fleetlock"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDBBackend ¶
type MongoDBBackend struct {
// contains filtered or unexported fields
}
func NewMongoDBBackend ¶
func NewMongoDBBackend(cfg MongoDBConfig) (*MongoDBBackend, error)
func (*MongoDBBackend) Close ¶
func (m *MongoDBBackend) Close() error
Calls all necessary finalization if necessary
func (*MongoDBBackend) GetLocks ¶
func (m *MongoDBBackend) GetLocks(group string) (int, error)
Returns the current number of locks for the given group
func (*MongoDBBackend) GetStaleLocks ¶
Return all locks older than x
func (*MongoDBBackend) HasLock ¶
func (m *MongoDBBackend) HasLock(group string, id string) (bool, error)
Check if a given id already has a lock for this group
type MongoDBConfig ¶
Click to show internal directories.
Click to hide internal directories.