[skip ci] Add comments for indexparamcheck (#8436)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
pull/8437/head
zhenshan.cao 2021-09-23 22:37:54 +08:00 committed by GitHub
parent eb413f1396
commit 98c423480e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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 {