func GetFuncString(labelName, defaultValue string) func(map[string]string) string {
	return func(labels map[string]string) string {
		return GetStringValue(labels, labelName, defaultValue)
	}
}
GetFuncString a func related to GetStringValue.
package label
import (
	"fmt"
	"log"
	"net/http"
	"strconv"
	"strings"
)
const (
	Prefix = "traefik."
)
const (
	mapEntrySeparator = "||"
	mapValueSeparator = ":"
)
func GetStringValue(labels map[string]string, labelName, defaultValue string) string {
	if value, ok := labels[labelName]; ok && len(value) > 0 {
		return value
	}
	return defaultValue
}
func GetBoolValue(labels map[string]string, labelName string, defaultValue bool) bool {
	rawValue, ok := labels[labelName]
	if ok {
		v, err := strconv.ParseBool(rawValue)
		if err == nil {
			return v
		}
		log.Printf("Unable to parse %q: %q, falling back to %v. %v", labelName, rawValue, defaultValue, err)
	}
	return defaultValue
}
func GetIntValue(labels map[string]string, labelName string, defaultValue int) int {
	if rawValue, ok := labels[labelName]; ok {
		value, err := strconv.Atoi(rawValue)
		if err == nil {
			return value
		}
		log.Printf("Unable to parse %q: %q, falling back to %v. %v", labelName, rawValue, defaultValue, err)
	}
	return defaultValue
}
func GetInt64Value(labels map[string]string, labelName string, defaultValue int64) int64 {
	if rawValue, ok := labels[labelName]; ok {
		value, err := strconv.ParseInt(rawValue, 10, 64)
		if err == nil {
			return value
		}
		log.Printf("Unable to parse %q: %q, falling back to %v. %v", labelName, rawValue, defaultValue, err)
	}
	return defaultValue
}
func GetSliceStringValue(labels map[string]string, labelName string) []string {
	value := make([]string, 0, 1)
	if values, ok := labels[labelName]; ok {
		value = SplitAndTrimString(values, ",")
		if len(value) == 0 {
			log.Printf("Could not load %q.", labelName)
		}
	}
	return value
}
func ParseMapValue(labelName, values string) map[string]string {
	mapValue := make(map[string]string)
	for _, parts := range strings.Split(values, mapEntrySeparator) {
		pair := strings.SplitN(parts, mapValueSeparator, 2)
		if len(pair) != 2 {
			log.Printf("Could not load %q: %q, skipping...", labelName, parts)
		} else {
			mapValue[http.CanonicalHeaderKey(strings.TrimSpace(pair[0]))] = strings.TrimSpace(pair[1])
		}
	}
	if len(mapValue) == 0 {
		log.Printf("Could not load %q, skipping...", labelName)
		return nil
	}
	return mapValue
}
func GetMapValue(labels map[string]string, labelName string) map[string]string {
	if values, ok := labels[labelName]; ok {
		if values == "" {
			log.Printf("Missing value for %q, skipping...", labelName)
			return nil
		}
		return ParseMapValue(labelName, values)
	}
	return nil
}
func GetStringMultipleStrict(labels map[string]string, labelNames ...string) (map[string]string, error) {
	foundLabels := map[string]string{}
	for _, name := range labelNames {
		value := GetStringValue(labels, name, "")
		if value == "" {
			return nil, fmt.Errorf("label not found: %s", name)
		}
		foundLabels[name] = value
	}
	return foundLabels, nil
}
func Has(labels map[string]string, labelName string) bool {
	value, ok := labels[labelName]
	return ok && len(value) > 0
}
func HasPrefix(labels map[string]string, prefix string) bool {
	for name, value := range labels {
		if strings.HasPrefix(name, prefix) && len(value) > 0 {
			return true
		}
	}
	return false
}
func SplitAndTrimString(base, sep string) []string {
	var trimmedStrings []string
	for _, s := range strings.Split(base, sep) {
		s = strings.TrimSpace(s)
		if len(s) > 0 {
			trimmedStrings = append(trimmedStrings, s)
		}
	}
	return trimmedStrings
}