Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseFactory ¶
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 ¶
func NewBaseFactory() *BaseFactory
NewBaseFactory returns a new client Basefactory.
func (*BaseFactory) GetV1APIClient ¶
func (f *BaseFactory) GetV1APIClient(address string) (promv1.API, error)
GetV1APIClient satisfies ClientFactory interface.
func (*BaseFactory) WithDefaultV1APIClient ¶
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 ¶
MockFactory returns a predefined prometheus v1 API client.
func (*MockFactory) GetV1APIClient ¶
func (m *MockFactory) GetV1APIClient(_ string) (promv1.API, error)
GetV1APIClient satisfies ClientFactory interface.
Click to show internal directories.
Click to hide internal directories.