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

Function ParseRevID

db/revision.go:428–438  ·  view source on GitHub ↗

ParseRevID splits a revision ID into generation number and hex digest. Logs a warning and returns -1, "" if the revID is invalid.

(ctx context.Context, revID string)

Source from the content-addressed store, hash-verified

426
427// ParseRevID splits a revision ID into generation number and hex digest. Logs a warning and returns -1, "" if the revID is invalid.
428func ParseRevID(ctx context.Context, revID string) (int, string) {
429 if revID == "" {
430 return 0, ""
431 }
432 generation, digest, err := parseRevID(revID)
433 if err != nil {
434 base.WarnfCtx(ctx, "%s", err)
435 return -1, ""
436 }
437 return generation, digest
438}
439
440// parseRevID splits a revision ID into generation number and hex digest. Returns an error if the revID is invalid.
441func parseRevID(revid string) (int, string, error) {

Callers 15

TestBulkGetWithCVFunction · 0.92
handleSyncFnDryRunMethod · 0.92
TestDocCRUDWithCVFunction · 0.92
upsertDocMethod · 0.92
PutNewEditsFalseMethod · 0.92
BenchmarkReadOps_ChangesFunction · 0.92

Calls 2

WarnfCtxFunction · 0.92
parseRevIDFunction · 0.85