Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(collection *mongo.Collection) dlock.Locker
New creates a MongoDB-backed Locker. It relies on MongoDB's unique index on `_id` and an upsert pattern. Note: To prevent expired locks from accumulating in the database, it is highly recommended to create a TTL index on the "expiresAt" field. Example: db.collection.createIndex({ "expiresAt": 1 }, { expireAfterSeconds: 0 })
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.