MCPcopy Create free account
hub / github.com/couchbase/moss / NewSnapshotWrapper

Function NewSnapshotWrapper

wrap.go:27–33  ·  view source on GitHub ↗

NewSnapshotWrapper creates a wrapper which provides ref-counting around a snapshot. The snapshot (and an optional io.Closer) will be closed when the ref-count reaches zero.

(ss Snapshot, closer io.Closer)

Source from the content-addressed store, hash-verified

25// around a snapshot. The snapshot (and an optional io.Closer) will
26// be closed when the ref-count reaches zero.
27func NewSnapshotWrapper(ss Snapshot, closer io.Closer) *SnapshotWrapper {
28 if ss == nil {
29 return nil
30 }
31
32 return &SnapshotWrapper{refCount: 1, ss: ss, closer: closer}
33}
34
35func (w *SnapshotWrapper) addRef() *SnapshotWrapper {
36 if w != nil {

Callers 3

runPersisterMethod · 0.85
NewCollectionFunction · 0.85
appendChildLLSnapshotMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…