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

Method AddChannel

channels/timed_set.go:159–167  ·  view source on GitHub ↗
(channelName string, atSequence uint64)

Source from the content-addressed store, hash-verified

157}
158
159func (set TimedSet) AddChannel(channelName string, atSequence uint64) bool {
160 if atSequence > 0 {
161 if oldSequence := set[channelName]; oldSequence.Sequence == 0 || atSequence < oldSequence.Sequence {
162 set[channelName] = NewVbSimpleSequence(atSequence)
163 return true
164 }
165 }
166 return false
167}
168
169// Merges the other set into the receiver. In case of collisions the earliest sequence wins.
170func (set TimedSet) Add(other TimedSet) bool {

Callers 5

AddAtSequenceMethod · 0.95
TestRebuildUserRolesFunction · 0.80
TestAccessFunctionDbFunction · 0.80

Calls 1

NewVbSimpleSequenceFunction · 0.85

Tested by 2

TestRebuildUserRolesFunction · 0.64
TestAccessFunctionDbFunction · 0.64