github.com/prebid/prebid-server/v2@v2.18.0/metrics/prometheus/type_conversion.go (about)

     1  package prometheusmetrics
     2  
     3  import (
     4  	"strconv"
     5  	"strings"
     6  )
     7  
     8  func enumAsString[T ~string](values []T) []string {
     9  	valuesAsString := make([]string, len(values))
    10  	for i, v := range values {
    11  		valuesAsString[i] = string(v)
    12  	}
    13  	return valuesAsString
    14  }
    15  
    16  func enumAsLowerCaseString[T ~string](values []T) []string {
    17  	valuesAsString := make([]string, len(values))
    18  	for i, v := range values {
    19  		valuesAsString[i] = strings.ToLower(string(v))
    20  	}
    21  	return valuesAsString
    22  }
    23  
    24  func boolValuesAsString() []string {
    25  	return []string{
    26  		strconv.FormatBool(true),
    27  		strconv.FormatBool(false),
    28  	}
    29  }