mongolock

package
v1.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL