client

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements a client for Kubelet, capable of retrieving prometheus metrics from a given endpoint.

func New

func New(connector Connector, opts ...OptionFunc) (*Client, error)

New builds a Client using the given options.

func (*Client) Get

func (c *Client) Get(urlPath string) (*http.Response, error)

Get implements HTTPGetter interface by sending GET request using configured client.

func (*Client) MetricFamiliesGetFunc

func (c *Client) MetricFamiliesGetFunc(url string) prometheus.FetchAndFilterMetricsFamilies

MetricFamiliesGetFunc returns a function that obtains metric families from a list of prometheus queries.

type Connector

type Connector interface {
	Connect() (*connParams, error)
}

Connector provides an interface to retrieve connParams to connect to a Kubelet instance.

func DefaultConnector

func DefaultConnector(kc kubernetes.Interface, config *config.Config, inClusterConfig *rest.Config, logger *log.Logger) Connector

DefaultConnector returns a defaultConnector that checks connection against local kubelet and api proxy.

func StaticConnector

func StaticConnector(client client.HTTPDoer, u url.URL) Connector

StaticConnector returns a fixed connector that does not check the connection when calling .Connect().

type OptionFunc

type OptionFunc func(kc *Client) error

func WithLogger

func WithLogger(logger *log.Logger) OptionFunc

WithLogger returns an OptionFunc to change the logger from the default noop logger.

func WithMaxRetries

func WithMaxRetries(retries int) OptionFunc

WithMaxRetries returns an OptionFunc to change the number of retries used int Pester Client.

Jump to

Keyboard shortcuts

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