internal

package
v0.0.0-...-450f66f Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerStatuses

type ContainerStatuses = v1.ContainerStatus

type ControlPlaneClient

type ControlPlaneClient interface {
	ListPods(ctx context.Context) (*v1.PodList, error)
	Healthz(ctx context.Context) Result
}

type Gauge

type Gauge = prometheus.Gauge

type GaugeOpts

type GaugeOpts = prometheus.GaugeOpts

type KubernetesClient

type KubernetesClient struct {
	// contains filtered or unexported fields
}

Real implementation of a Kubernetes client

func NewKubernetesClient

func NewKubernetesClient(log zerolog.Logger) *KubernetesClient

func (*KubernetesClient) Healthz

func (k *KubernetesClient) Healthz(ctx context.Context) Result

func (*KubernetesClient) ListPods

func (k *KubernetesClient) ListPods(ctx context.Context) (*PodList, error)

type MetricsClient

type MetricsClient interface {
	NewGauge(opts prometheus.GaugeOpts) Gauge
}

MetricsClient is a prometheus metrics client

type MockKubernetesClient

type MockKubernetesClient struct {
	PodList *PodList
	Error   error
}

MockKubernetesClient is a mock implementation of KubernetesClient. It's used for testing. Normally I'd just use like https://github.com/golang/mock

func (*MockKubernetesClient) Healthz

func (m *MockKubernetesClient) Healthz(ctx context.Context) Result

func (*MockKubernetesClient) ListPods

func (m *MockKubernetesClient) ListPods(ctx context.Context) (*PodList, error)

type NoopMetrics

type NoopMetrics struct{}

NoopMetrics is an empty metrics client that doesn't register to any metrics collector

func (*NoopMetrics) NewGauge

func (n *NoopMetrics) NewGauge(opts prometheus.GaugeOpts) Gauge

NewGauge will create an empty prometheus counter but will not register it

type ObjectMeta

type ObjectMeta = metav1.ObjectMeta

type Pod

type Pod = v1.Pod

type PodList

type PodList = v1.PodList

type PodStatus

type PodStatus = v1.PodStatus

type PrometheusMetrics

type PrometheusMetrics struct{}

PrometheusMetrics represents a prometheus metrics client

func (*PrometheusMetrics) NewGauge

func (p *PrometheusMetrics) NewGauge(opts prometheus.GaugeOpts) Gauge

NewGauge returns a new counter metric that's registered to the automatic prometheus collector

type Result

type Result = rest.Result

type Time

type Time = metav1.Time

Jump to

Keyboard shortcuts

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