CVEqual returns true if the provided CV does not match _sync.rev.ver and _sync.rev.src. The caller is responsible for testing if the values are non-empty.
(cv Version)
| 663 | |
| 664 | // CVEqual returns true if the provided CV does not match _sync.rev.ver and _sync.rev.src. The caller is responsible for testing if the values are non-empty. |
| 665 | func (s *SyncData) CVEqual(cv Version) bool { |
| 666 | if cv.SourceID != s.RevAndVersion.CurrentSource { |
| 667 | return false |
| 668 | } |
| 669 | return cv.Value == base.HexCasToUint64(s.RevAndVersion.CurrentVersion) |
| 670 | } |
| 671 | |
| 672 | // IsSGWrite determines if a document was written by Sync Gateway or via an SDK. CV is an optional parameter to check. This would represent _vv.ver and _vv.src |
| 673 | func (s *SyncData) IsSGWrite(ctx context.Context, cas uint64, rawBody []byte, rawUserXattr []byte, cv cvExtractor) (isSGWrite bool, crc32Match bool, bodyChanged bool) { |