• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / go-storage / 26234582722
90%

Build:
DEFAULT BRANCH: master
Ran 21 May 2026 03:08PM UTC
Jobs 1
Files 49
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 May 2026 03:07PM UTC coverage: 90.053% (+0.02%) from 90.034%
26234582722

push

github

bigbes
locker: add Done/Do/Prefixed helpers and make Factory an interface

Done() returns a channel closed when the Locker is no longer holding
the lock — either after Unlock or when the backend session is lost
(TTL elapsed without renewal, connection dropped). The channel
reflects the most recent successful Lock/TryLock; calls before any
acquire return an already-closed channel. Each driver wires Done to
its existing liveness signal: dummy uses a per-Lock channel closed on
Unlock, tcs reuses the keepalive-failure channel guarded by sync.Once
so Unlock and the keepalive loop never double-close, and etcd returns
concurrency.Session.Done().

Do is the acquire-work-release helper. It takes a Factory, name, work
function, and Options; builds the Locker, acquires it, runs fn while
held, then unlocks — even if fn errors. fn's result is the leading
error so errors.Is against domain sentinels keeps working; Unlock
errors are joined via errors.Join only when fn also failed. README's
distributed-locks section now leads with locker.Do as the recommended
pattern; the manual Lock/Unlock form is reserved for locks that must
outlive a single function call.

Prefixed wraps a locker.Factory to scope every NewLocker name under a
common prefix — mirrors storage.Prefixed but operates on Factory
only, so callers can hand a name-scoped lock binder to a subcomponent
without exposing the full Storage. The prefix is concatenated to the
caller-supplied name with no separator, matching
storage.Prefixed.NewLocker. An empty prefix returns the inner Factory
unchanged. A non-empty prefix must start with "/"
(ErrPrefixNoLeadingSlash) and must not end with "/"
(ErrPrefixTrailingSlash); interior "/" separators are allowed.

Convert Factory from a function type to an interface with a NewLocker
method. Any type with a matching NewLocker satisfies it directly, so
Storage and the Prefixed wrapper need no adapter; FactoryFunc adapts
a bare function for ad-hoc cases (e.g. tests), mirroring
http.Ha... (continued)

91 of 107 new or added lines in 8 files covered. (85.05%)

3757 of 4172 relevant lines covered (90.05%)

518.4 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
42.15
0.12% driver/tcs/locker.go
4
81.82
locker/do.go
Jobs
ID Job ID Ran Files Coverage
1 26234582722.1 21 May 2026 03:08PM UTC 49
90.05
GitHub Action Run
Source Files on build 26234582722
  • Tree
  • List 49
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 77b6fa81 on github
  • Prev Build on master (#26233039368)
  • Next Build on master (#26288689338)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc