Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
lock
✓ github.com/square/mongo-lock
Create a distributed lock in MongoDB.
package main
import (
"context"
"github.com/square/mongo-lock"
"go.mongodb.org/mongo-driver/mongo"
)
func main() {
client, _ := mongo.Connect(context.Background())
c := lock.NewClient(client.Database("locks").Collection("locks"))
c.Create(context.Background(), "my-lock")
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.0.0-20230808145049-cfcf499f6bf0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.