mirror of https://github.com/milvus-io/milvus.git
[skip ci] Add comments for indexparamcheck (#8436)
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>pull/8437/head
parent
eb413f1396
commit
98c423480e
|
@ -6,6 +6,9 @@ import (
|
|||
"github.com/milvus-io/milvus/internal/util/funcutil"
|
||||
)
|
||||
|
||||
// Check whether the data corresponding to the key is within the range of [min, max].
|
||||
// If the key does not exist, or the data cannot be converted to an int type number, or the number is not in the range [min, max], return false
|
||||
// Otherwise, return true
|
||||
func CheckIntByRange(params map[string]string, key string, min, max int) bool {
|
||||
valueStr, ok := params[key]
|
||||
if !ok {
|
||||
|
@ -20,6 +23,9 @@ func CheckIntByRange(params map[string]string, key string, min, max int) bool {
|
|||
return value >= min && value <= max
|
||||
}
|
||||
|
||||
// Check whether the data corresponding to the key appears in the string slice of container.
|
||||
// If the key does not exist, or the data does not appear in the container, return false
|
||||
// Otherwise return true
|
||||
func CheckStrByValues(params map[string]string, key string, container []string) bool {
|
||||
value, ok := params[key]
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in New Issue