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

Method Validate

rest/admin_api.go:286–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284}
285
286func (req PostIndexInitRequest) Validate() error {
287 if req.NumPartitions == nil && req.SeparatePrincipalIndexes == nil {
288 return base.HTTPErrorf(http.StatusBadRequest, "at least one of num_partitions or create_separate_principal_indexes is required")
289 }
290 if req.NumPartitions != nil && *req.NumPartitions < 1 {
291 return base.HTTPErrorf(http.StatusBadRequest, "num_partitions must be greater than 0")
292 }
293 return nil
294}
295
296// handleIndexInit allows async index initialization to be run or managed
297func (h *handler) handlePostIndexInit() error {

Callers 1

handlePostIndexInitMethod · 0.95

Calls 1

HTTPErrorfFunction · 0.92

Tested by

no test coverage detected