MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / ChangeVersionString

Method ChangeVersionString

db/changes.go:68–79  ·  view source on GitHub ↗

ChangeVersionString returns the first version string we found in the ChangeEntry.

(ctx context.Context)

Source from the content-addressed store, hash-verified

66
67// ChangeVersionString returns the first version string we found in the ChangeEntry.
68func (ce *ChangeEntry) ChangeVersionString(ctx context.Context) string {
69 if len(ce.Changes) == 0 {
70 base.AssertfCtx(ctx, "ChangesEntry has no changes: %s", ce.String())
71 return ""
72 }
73 // pick just the first entry in changes
74 for _, changeVersionString := range ce.Changes[0] {
75 // whichever version is present we'll return it - only expected to have one version type populated - since the feed is initialized with a preferred version type.
76 return changeVersionString
77 }
78 return ""
79}
80
81// A changes entry; Database.GetChanges returns an array of these.
82// Marshals into the standard CouchDB _changes format.

Callers 3

AuditReadEventMethod · 0.95
addDocToChangeEntryMethod · 0.80

Calls 2

StringMethod · 0.95
AssertfCtxFunction · 0.92

Tested by

no test coverage detected