rename IsMatchEveryIndex to IsWildcard

This commit is contained in:
koba1t
2022-02-10 05:13:29 +09:00
parent 22f9daa3ab
commit 5ed96a34d7
4 changed files with 79 additions and 8 deletions

View File

@@ -789,6 +789,12 @@ func IsIdxNumber(p string) bool {
return err == nil && idx >= 0
}
// IsWildcard returns true if p is matching every elements.
// e.g. "*"
func IsWildcard(p string) bool {
return p == "*"
}
// SplitIndexNameValue splits a lookup part Val index into the field name
// and field value to match.
// e.g. splits [name=nginx] into (name, nginx)
@@ -803,12 +809,6 @@ func SplitIndexNameValue(p string) (string, string, error) {
return parts[0], parts[1], nil
}
// IsMatchEveryIndex returns true if p is matching every elements.
// e.g. "*"
func IsMatchEveryIndex(p string) bool {
return p == "*"
}
// IncrementFieldIndex increments i to point to the next field name element in
// a slice of Contents.
func IncrementFieldIndex(i int) int {