| 768 | } |
| 769 | |
| 770 | func changesViewOptions(channelName string, startSeq, endSeq uint64, limit int) map[string]interface{} { |
| 771 | endKey := []interface{}{channelName, endSeq} |
| 772 | if endSeq == 0 { |
| 773 | endKey[1] = map[string]interface{}{} // infinity |
| 774 | } |
| 775 | optMap := map[string]interface{}{ |
| 776 | "stale": false, |
| 777 | QueryParamStartKey: []interface{}{channelName, startSeq}, |
| 778 | QueryParamEndKey: endKey, |
| 779 | } |
| 780 | if limit > 0 { |
| 781 | optMap[QueryParamLimit] = limit |
| 782 | } |
| 783 | return optMap |
| 784 | } |
| 785 | |
| 786 | type EmptyResultIterator struct{} |
| 787 | |