prometheus

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseFactory added in v0.3.0

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

BaseFactory returns Prometheus clients based on the address. This factory implements a way of returning default Prometheus clients in case it was set.

func NewBaseFactory added in v0.3.0

func NewBaseFactory() *BaseFactory

NewBaseFactory returns a new client Basefactory.

func (*BaseFactory) GetV1APIClient added in v0.3.0

func (f *BaseFactory) GetV1APIClient(address string) (promv1.API, error)

GetV1APIClient satisfies ClientFactory interface.

func (*BaseFactory) WithDefaultV1APIClient added in v0.3.0

func (f *BaseFactory) WithDefaultV1APIClient(address string) error

WithDefaultV1APIClient sets a default client for V1 api client.

type ClientFactory

type ClientFactory interface {
	// GetV1APIClient returns a new prometheus v1 API client.
	// address is the address of the prometheus.
	GetV1APIClient(address string) (promv1.API, error)
}

ClientFactory knows how to get prometheus API clients.

func NewFakeFactory

func NewFakeFactory() ClientFactory

NewFakeFactory returns a new fake factory.

type MockFactory

type MockFactory struct {
	Cli promv1.API
}

MockFactory returns a predefined prometheus v1 API client.

func (*MockFactory) GetV1APIClient

func (m *MockFactory) GetV1APIClient(_ string) (promv1.API, error)

GetV1APIClient satisfies ClientFactory interface.

Jump to

Keyboard shortcuts

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