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

Function GetRestrictedIntFromString

base/util.go:1527–1545  ·  view source on GitHub ↗
(rawValue string, defaultValue, minValue, maxValue uint64, allowZero bool)

Source from the content-addressed store, hash-verified

1525}
1526
1527func GetRestrictedIntFromString(rawValue string, defaultValue, minValue, maxValue uint64, allowZero bool) uint64 {
1528 var value *uint64
1529 if rawValue != "" {
1530 intValue, err := strconv.ParseUint(rawValue, 10, 64)
1531 if err != nil {
1532 value = nil
1533 } else {
1534 value = &intValue
1535 }
1536 }
1537
1538 return GetRestrictedInt(
1539 value,
1540 defaultValue,
1541 minValue,
1542 maxValue,
1543 allowZero,
1544 )
1545}
1546
1547func GetRestrictedInt(rawValue *uint64, defaultValue, minValue, maxValue uint64, allowZero bool) uint64 {
1548

Callers 2

batchSizeMethod · 0.92
GetRestrictedIntQueryFunction · 0.85

Calls 1

GetRestrictedIntFunction · 0.85

Tested by

no test coverage detected