common

package
v0.0.0-...-3d4b6db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Base64  string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$"
	Percent string = "^[0-9]+%$"
)

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique(slice []interface{}, i interface{}) []interface{}

func AppendUniqueIndex

func AppendUniqueIndex(slice []interface{}, i interface{}, idx string, override bool) []interface{}

func ConcatenateList

func ConcatenateList(list []string, delimiter string) string

ConcatenateList joins lists to strings delimited with `delimiter`

func ContainsEqualFold

func ContainsEqualFold(slice []string, s string) bool

ContainsEqualFold returns true if a given slice 'slice' contains string 's' under unicode case-folding

func ContainsEqualFoldSubstring

func ContainsEqualFoldSubstring(str, substr string) bool

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString returns true if a given slice 'slice' contains string 's', otherwise return false

func Difference

func Difference(a, b []string) []string

Set Difference: A - B

func FieldPath

func FieldPath(path string) []string

func FieldPathString

func FieldPathString(path ...string) string

func FieldValue

func FieldValue(path string, obj map[string]interface{}) interface{}

func GetDecodedString

func GetDecodedString(str string) (string, error)

func GetGroupsForOsFamily

func GetGroupsForOsFamily(osFamily string) []string

func GetLastElementBy

func GetLastElementBy(s, sep string) string

func GetNodeBootstrapRemove

func GetNodeBootstrapRemove(arn string, osFamily string) *awsauth.MapperArguments

func GetNodeBootstrapUpsert

func GetNodeBootstrapUpsert(arn string, osFamily string) *awsauth.MapperArguments

func GetTimeString

func GetTimeString() string

func Int64InRange

func Int64InRange(i, min, max int64) bool

func Int64ToStr

func Int64ToStr(x int64) string

func Int64Value

func Int64Value(i *int64) int64

func IntOrStrValue

func IntOrStrValue(x *intstr.IntOrString) int

func IsBase64

func IsBase64(str string) bool

func IsValidPercent

func IsValidPercent(percent string) error

func MapEmpty

func MapEmpty(m map[string]string) bool

func MergeSliceByIndex

func MergeSliceByIndex(sl1, sl2 []interface{}, idx string, override bool) []interface{}

func MergeSliceByUnique

func MergeSliceByUnique(sl1, sl2 []interface{}) []interface{}

func Min

func Min(a, b int64) int64

func ReadFile

func ReadFile(path string) ([]byte, error)

func RemoveAuthConfigMap

func RemoveAuthConfigMap(kube kubernetes.Interface, arns []string, osFamilies []string) error

func SetFieldValue

func SetFieldValue(path string, obj map[string]interface{}, value interface{}) error

func SliceEmpty

func SliceEmpty(slice []string) bool

func StringEmpty

func StringEmpty(str string) bool

func StringMD5

func StringMD5(s string) string

func StringMapSliceContains

func StringMapSliceContains(m []map[string]string, contains map[string]string) bool

func StringPtr

func StringPtr(str string) *string

func StringSliceContains

func StringSliceContains(x, y []string) bool

func StringSliceEqualFold

func StringSliceEqualFold(x []string, y []string) bool

func StringSliceEquals

func StringSliceEquals(x, y []string) bool

func StringValue

func StringValue(str *string) string

func UpsertAuthConfigMap

func UpsertAuthConfigMap(kube kubernetes.Interface, arns []string, osFamilies []string) error

Types

type MetricsCollector

type MetricsCollector struct {
	prometheus.Collector
	// contains filtered or unexported fields
}

func NewMetricsCollector

func NewMetricsCollector() *MetricsCollector

func (MetricsCollector) Collect

func (c MetricsCollector) Collect(ch chan<- prometheus.Metric)

func (MetricsCollector) Describe

func (c MetricsCollector) Describe(ch chan<- *prometheus.Desc)

func (*MetricsCollector) IncFail

func (c *MetricsCollector) IncFail(instanceGroup, reason string)

func (*MetricsCollector) IncSuccess

func (c *MetricsCollector) IncSuccess(instanceGroup string)

func (*MetricsCollector) IncThrottle

func (c *MetricsCollector) IncThrottle(serviceName, operationName string)

func (*MetricsCollector) SetInstanceGroup

func (c *MetricsCollector) SetInstanceGroup(instanceGroup, state string)

func (*MetricsCollector) UnsetInstanceGroup

func (c *MetricsCollector) UnsetInstanceGroup()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL