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

Function populateDocChannelInfo

rest/diagnostic_doc_api.go:69–80  ·  view source on GitHub ↗
(doc db.Document)

Source from the content-addressed store, hash-verified

67}
68
69func populateDocChannelInfo(doc db.Document) map[string][]auth.GrantHistorySequencePair {
70 resp := make(map[string][]auth.GrantHistorySequencePair, len(doc.Channels))
71
72 for _, chanSetInfo := range doc.SyncData.ChannelSet {
73 resp[chanSetInfo.Name] = append(resp[chanSetInfo.Name], auth.GrantHistorySequencePair{StartSeq: chanSetInfo.Start, EndSeq: chanSetInfo.End})
74 }
75 for _, hist := range doc.SyncData.ChannelSetHistory {
76 resp[hist.Name] = append(resp[hist.Name], auth.GrantHistorySequencePair{StartSeq: hist.Start, EndSeq: hist.End, Compacted: hist.Compacted})
77 continue
78 }
79 return resp
80}
81
82// HTTP handler for a GET of a document's channels and their sequence spans
83func (h *handler) handleGetDocChannels() error {

Callers 2

handleGetDocChannelsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected