Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrExtractorTypeMismatch = errors.New("extractor type mismatch")
Functions ¶
This section is empty.
Types ¶
type Addressable ¶
type Addressable interface {
GetIPAddress() string
GetPort() string
GetMetricsHost() string
GetNamespacedName() types.NamespacedName
}
Addressable supports getting an IP address and a namespaced name.
type Client ¶
type Client interface {
Get(ctx context.Context, target *url.URL, ep Addressable, parser func(io.Reader) (any, error)) (any, error)
}
Client is an interface for retrieving the data from an endpoint URL.
type HTTPDataSource ¶
type HTTPDataSource[T any] struct { // contains filtered or unexported fields }
HTTPDataSource is a typed polling dispatcher. T is the data type the source produces; bound extractors must implement Extractor[PollInput[T]].
func NewHTTPDataSource ¶
func NewHTTPDataSource[T any](scheme, path string, skipCertVerification bool, pluginType, pluginName string, parser func(io.Reader) (T, error)) (*HTTPDataSource[T], error)
NewHTTPDataSource constructs a typed polling dispatcher.
func (*HTTPDataSource[T]) AppendExtractor ¶
func (s *HTTPDataSource[T]) AppendExtractor(ext fwkplugin.Plugin) error
AppendExtractor binds ext as a typed PollingExtractor[T]. Duplicate-Type detection is the caller's responsibility (see runtime.Configure); this is a pure append.
func (*HTTPDataSource[T]) Dispatch ¶
Dispatch polls the endpoint and fans the result out to every bound extractor. Each step (Poll and each Extract) runs under its own defaultStepTimeout so one slow extractor does not starve siblings.
Return contract: a non-nil return indicates a poll-level failure (the dispatcher could not produce data). Per-extractor failures are recorded in DataLayerExtractErrorsTotal and do NOT surface as a returned error. This keeps the collector's poll/extract counters cleanly separated.
func (*HTTPDataSource[T]) Poll ¶
Poll fetches and parses one tick. Exposed for tests; runtime uses Dispatch.
func (*HTTPDataSource[T]) TypedName ¶
func (s *HTTPDataSource[T]) TypedName() fwkplugin.TypedName