Documentation ¶
Overview ¶
Package plugin is the package that defines the reporter plugin, and those strategies must implement ReporterPlugin interface, supporting both embedded plugin and external registered plugin.
Index ¶
- type DummyReporterPlugin
- func (_ DummyReporterPlugin) GetCache() *v1alpha1.GetReportContentResponse
- func (_ DummyReporterPlugin) GetReportContent(c context.Context) (*v1alpha1.GetReportContentResponse, error)
- func (_ DummyReporterPlugin) ListAndWatchReportContentCallback(s string, response *v1alpha1.GetReportContentResponse)
- func (_ DummyReporterPlugin) Name() string
- func (_ DummyReporterPlugin) Run(success chan<- bool)
- type Endpoint
- type InitFunc
- type ListAndWatchCallback
- type ReporterPlugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyReporterPlugin ¶
type DummyReporterPlugin struct {
*util.StopControl
}
func (DummyReporterPlugin) GetCache ¶
func (_ DummyReporterPlugin) GetCache() *v1alpha1.GetReportContentResponse
func (DummyReporterPlugin) GetReportContent ¶
func (_ DummyReporterPlugin) GetReportContent(c context.Context) (*v1alpha1.GetReportContentResponse, error)
func (DummyReporterPlugin) ListAndWatchReportContentCallback ¶
func (_ DummyReporterPlugin) ListAndWatchReportContentCallback(s string, response *v1alpha1.GetReportContentResponse)
func (DummyReporterPlugin) Name ¶
func (_ DummyReporterPlugin) Name() string
func (DummyReporterPlugin) Run ¶
func (_ DummyReporterPlugin) Run(success chan<- bool)
type Endpoint ¶
type Endpoint interface { // Run initializes a ListAndWatch steam which will send a signal to the success channel // when it initializes successfully Run(success chan<- bool) // Stop will be call when this Endpoint was de-registered or some error happened in ListAndWatch Stop() // GetReportContent will call rpc GetReportContent to plugin directly GetReportContent(c context.Context) (*v1alpha1.GetReportContentResponse, error) // ListAndWatchReportContentCallback will be call when this Endpoint receives plugin ListAndWatch send ListAndWatchReportContentCallback(string, *v1alpha1.GetReportContentResponse) // GetCache get response cache of this Endpoint GetCache() *v1alpha1.GetReportContentResponse // IsStopped check this Endpoint whether be called stop function before IsStopped() bool // StopGracePeriodExpired check if this Endpoint has been stopped and exceeded the // grace period since the stop timestamp StopGracePeriodExpired() bool }
Endpoint represents a single registered plugin. It is responsible for managing gRPC communications with the reporter plugin and caching reporter states.
func NewRemoteEndpoint ¶
func NewRemoteEndpoint(socketPath, pluginName string, emitter metrics.MetricEmitter, callback ListAndWatchCallback) (Endpoint, error)
NewRemoteEndpoint creates a new Endpoint for the given reporter' plugin name. This is to be used during normal reporter' plugin registration.
func NewStoppedRemoteEndpoint ¶
func NewStoppedRemoteEndpoint(pluginName string, cache *v1alpha1.GetReportContentResponse) Endpoint
NewStoppedRemoteEndpoint creates a new Endpoint for the given pluginName with stopTime set. This is to be used during Agent restart, before the actual reporter plugin re-registers.
type InitFunc ¶
type InitFunc func(emitter metrics.MetricEmitter, _ *metaserver.MetaServer, conf *config.Configuration, callback ListAndWatchCallback) (ReporterPlugin, error)
type ListAndWatchCallback ¶
type ListAndWatchCallback func(string, *v1alpha1.GetReportContentResponse)
ListAndWatchCallback should be called when plugins report info update.
type ReporterPlugin ¶
ReporterPlugin performs report actions based on system or kubelet information.