MCPcopy
hub / github.com/gofiber/fiber / MemoryLock

Struct MemoryLock

middleware/idempotency/locker.go:20–23  ·  view source on GitHub ↗

MemoryLock coordinates access to idempotency keys using in-memory locks. MemoryLock is safe for concurrent use.

Source from the content-addressed store, hash-verified

18// MemoryLock coordinates access to idempotency keys using in-memory locks.
19// MemoryLock is safe for concurrent use.
20type MemoryLock struct {
21 keys map[string]*countedLock
22 mu sync.Mutex
23}
24
25// Lock acquires the lock for the provided key, creating it when necessary.
26func (l *MemoryLock) Lock(key string) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected