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

Function seqStr

db/sequence_id.go:71–80  ·  view source on GitHub ↗
(ctx context.Context, seq interface{})

Source from the content-addressed store, hash-verified

69}
70
71func seqStr(ctx context.Context, seq interface{}) string {
72 switch seq := seq.(type) {
73 case string:
74 return seq
75 case json.Number:
76 return seq.String()
77 }
78 base.WarnfCtx(ctx, "unknown seq type: %T", seq)
79 return ""
80}
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) {

Callers 1

handleChangesMethod · 0.85

Calls 2

WarnfCtxFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected