common

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = logrus.New()

Log is the common logger

Functions

func GetSelectorString

func GetSelectorString(selector *metav1.LabelSelector) (string, error)

func HomeDir

func HomeDir() string

HomeDir gets the current user's homedir

func InClusterAuth

func InClusterAuth() (*kubernetes.Clientset, error)

InClusterAuth returns an in-cluster kubernetes client

func OutOfClusterAuth

func OutOfClusterAuth(providedConfigPath string) (*kubernetes.Clientset, error)

OutOfClusterAuth returns an external kubernetes client

func PathExists

func PathExists(path string) bool

PathExists checks whether a given path exists or not

func StringSliceContains

func StringSliceContains(sl []string, s string) bool

Types

type MetricsAPI

type MetricsAPI interface {
	// Set Metric value on metric
	SetMetricValue(metricName string, tags map[string]string, value float64) error
}

type PrometheusAPI

type PrometheusAPI struct {
	//Base URL
	Pushgateway string
}

API for Query Metrics

func NewPrometheusAPI

func NewPrometheusAPI(pushgateway string) *PrometheusAPI

func (*PrometheusAPI) SetMetricValue

func (a *PrometheusAPI) SetMetricValue(metricName string, tags map[string]string, value float64) error

Jump to

Keyboard shortcuts

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