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

Function ParseJSONSequenceID

db/sequence_id.go:83–86  ·  view source on GitHub ↗

ParseJSONSequenceID will parse a JSON string sequence ID. (e.g. accepts: `"1::3"`, `2`, and also a plain sequence like `1::3`)

(str string)

Source from the content-addressed store, hash-verified

81
82// ParseJSONSequenceID will parse a JSON string sequence ID. (e.g. accepts: `"1::3"`, `2`, and also a plain sequence like `1::3`)
83func ParseJSONSequenceID(str string) (SequenceID, error) {
84 plainStr := base.ConvertJSONString(str)
85 return ParsePlainSequenceID(plainStr)
86}
87
88// ParsePlainSequenceID will parse a plain sequence string - but not a JSON sequence string (e.g. accepts: `1::3` but not `"1::3"`)
89// Calling this with a JSON string will result in an error. Use ParseJSONSequenceID instead.

Callers 4

NewSubChangesParamsFunction · 0.85
handleChangesMethod · 0.85
handleNoRevMethod · 0.85
processRevMethod · 0.85

Calls 2

ConvertJSONStringFunction · 0.92
ParsePlainSequenceIDFunction · 0.85

Tested by

no test coverage detected