Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIRest ¶
type APIRest struct {
// contains filtered or unexported fields
}
APIRest have common data to be shared through embedded struct in those type who implement the client.Client interface
type APIRestCreator ¶
type APIRestCreator struct {
// contains filtered or unexported fields
}
APIRestCreator have info to create api rest an client
func (APIRestCreator) CreateClient ¶
func (ac APIRestCreator) CreateClient() (cl CacheableClient, err error)
CreateClient create an api rest client
type CacheableClient ¶
CacheableClient should return a key(DataPath) for catching resource values
type CacheableFactory ¶
type CacheableFactory interface {
CreateClient() (cl CacheableClient, err error)
}
CacheableFactory can create different kind of cacheable clients
func CreateAPIRestCreator ¶
func CreateAPIRestCreator(resConf config.RextResourceDef, srvConf config.RextServiceDef, dataSourceResponseDurationDesc *prometheus.Desc) (cf CacheableFactory, err error)
CreateAPIRestCreator create an APIRestCreator
type Catcher ¶
type Catcher struct {
// contains filtered or unexported fields
}
Catcher have a client and a cache to save time loading data
type CatcherCreator ¶
type CatcherCreator struct { Cache cache.Cache ClientFactory CacheableFactory }
CatcherCreator have info to create catcher client
func (CatcherCreator) CreateClient ¶
func (cc CatcherCreator) CreateClient() (cl Client, err error)
CreateClient create a catcher client
type Client ¶
type Client interface { // GetData will get tha date based on a URL(but can be a cached value for example). GetData(metricsCollector chan<- prometheus.Metric) (body []byte, err error) }
Client to get remote data.
type FordwaderClient ¶
FordwaderClient a client to get metrics from a metrics endpoint
type FordwaderFactory ¶
type FordwaderFactory interface {
CreateClient() (cl FordwaderClient, err error)
}
FordwaderFactory create fordwader client
type ProxyMetricClient ¶
type ProxyMetricClient struct {
// contains filtered or unexported fields
}
ProxyMetricClient implements the getRemoteInfo method from `client.Client` interface by using some `.toml` config parameters like for example: where is the host. It get the exposed metrics from a service as is.
func (ProxyMetricClient) GetData ¶
func (client ProxyMetricClient) GetData() (data []byte, err error)
GetData can get raw metrics from a endpoint
type ProxyMetricClientCreator ¶
type ProxyMetricClientCreator struct { JobName string InstanceName string // contains filtered or unexported fields }
ProxyMetricClientCreator create a metrics fordwader client
func CreateProxyMetricClientCreator ¶
func CreateProxyMetricClientCreator(resConf config.RextResourceDef, srvConf config.RextServiceDef, fDefMetrics *metrics.DefaultFordwaderMetrics) (cf ProxyMetricClientCreator, err error)
CreateProxyMetricClientCreator create a ProxyMetricClientCreator with required info to create a metrics fordwader client
func (ProxyMetricClientCreator) CreateClient ¶
func (pmc ProxyMetricClientCreator) CreateClient() (cl FordwaderClient, err error)
CreateClient create a metrics forwader client
type TokenClient ¶
type TokenClient struct {
// contains filtered or unexported fields
}
TokenClient implements the getRemoteInfo method from `client.Client` interface by using some .toml config parameters like for example: where is the host? it should be a GET, a POST or some other ... It works like an http wrapper to to get a token from the server. sa newTokenClient method.
func (TokenClient) GetData ¶
func (client TokenClient) GetData(metricsCollector chan<- prometheus.Metric) (data []byte, err error)
GetData can get a token value from a remote server
type TokenCreator ¶
type TokenCreator baseFactory
TokenCreator create token clients
func (TokenCreator) CreateClient ¶
func (tc TokenCreator) CreateClient() (cl Client, err error)
CreateClient create a token client