Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions contrib/cbconfig/cbconfig.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
package cbconfig

import "slices"

type VBucketServerMapJson struct {
HashAlgorithm string `json:"hashAlgorithm"`
NumReplicas int `json:"numReplicas"`
ServerList []string `json:"serverList"`
VBucketMap [][]int `json:"vBucketMap,omitempty"`
}

// TODO - have this take pointer args and handle the nil case
func (vbMap VBucketServerMapJson) Equal(otherMap VBucketServerMapJson) bool {
for i, vb := range vbMap.VBucketMap {
if !slices.Equal(vb, otherMap.VBucketMap[i]) {
return false
}
}

return slices.Equal(vbMap.ServerList, otherMap.ServerList)
}

type ConfigDDocsJson struct {
URI string `json:"uri,omitempty"`
}
Expand Down
Loading