prometheus

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 6 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 {
	URL      string
	Username string
	Password string
	// contains filtered or unexported fields
}

Client defines a Prometheus client.

func New

func New(opts ...Option) (*Client, error)

New initializes a new Prometheus client.

func (*Client) RoundTrip

func (c *Client) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip implements the RoundTripper interface.

func (*Client) Targets

func (c *Client) Targets() ([]map[string]interface{}, error)

Targets fetches and parses the targets from Prometheus API endpoint.

type Option

type Option func(*Client)

Option configures a client option.

func WithPassword

func WithPassword(val string) Option

WithPassword returns an option to set password.

func WithURL

func WithURL(val string) Option

WithURL returns an option to set url.

func WithUsername

func WithUsername(val string) Option

WithUsername returns an option to set username.

Jump to

Keyboard shortcuts

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