Documentation ¶
Overview ¶
Package query provides the query/poller implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoData = errors.New("no data collected yet in the poller")
Functions ¶
This section is empty.
Types ¶
type GetFunc ¶
Queries the component data from the host. Each get output is persisted to the storage if enabled.
type Item ¶
type Item struct { Time metav1.Time `json:"time"` // Generic component output. // Either Output or OutputEncoded should be set. Output any `json:"output,omitempty"` Error error `json:"error,omitempty"` }
Item is the basic unit of data that poller returns. If enabled, each result is persisted in the storage.
type Poller ¶
type Poller interface { // Returns the poller ID. ID() string // Starts the poller routine. // Redundant calls will be skipped if there's an existing poller. Start(ctx context.Context, cfg query_config.Config, componentName string) // Config returns the config used to start the poller. // This is useful for debugging and logging. Config() query_config.Config // Stops the poller routine. // Safe to call multiple times. // Returns "true" if the poller was stopped with its reference count being zero. Stop(componentName string) bool // Last returns the last item in the queue. // It returns ErrNoData if no item is collected yet. Last() (*Item, error) // All returns all results in the queue since the given time. // It returns ErrNoData if no item is collected yet. All(since time.Time) ([]Item, error) }
Defines the common query/poller interface. It polls the data source (rather than watch) in order to share the same data source with multiple components (consumer). Poll is better when there are multiple consumers (e.g., multiple log tailers) reading from the same file.
Directories ¶
Path | Synopsis |
---|---|
Package config provides the query/poller configuration.
|
Package config provides the query/poller configuration. |
Package log provides the log file/output poller implementation.
|
Package log provides the log file/output poller implementation. |
common
Package common provides the common log components.
|
Package common provides the common log components. |
config
Package config provides the log poller configuration.
|
Package config provides the log poller configuration. |
state
Package state provides the persistent storage layer for the log poller.
|
Package state provides the persistent storage layer for the log poller. |
tail
Package tail implements the log file/output tail-ing operations.
|
Package tail implements the log file/output tail-ing operations. |
Click to show internal directories.
Click to hide internal directories.