Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStatusNotReady = errors.New("report component status is not ready until service start")
ErrStatusNotReady is returned when trying to report status before service start
Functions ¶
func NewReportStatusFunc ¶ added in v0.92.0
func NewReportStatusFunc( id *component.InstanceID, srvStatus ServiceStatusFunc, ) func(*component.StatusEvent)
NewReportStatusFunc returns a function to be used as ReportStatus for component.TelemetrySettings
Types ¶
type InvalidTransitionFunc ¶ added in v0.92.0
type InvalidTransitionFunc func(error)
InvalidTransitionFunc is the receiver of invalid transition errors
type NotifyStatusFunc ¶
type NotifyStatusFunc func(*component.InstanceID, *component.StatusEvent)
NotifyStatusFunc is the receiver of status events after successful state transitions
type Reporter ¶ added in v0.91.0
type Reporter interface { Ready() ReportStatus(id *component.InstanceID, ev *component.StatusEvent) ReportOKIfStarting(id *component.InstanceID) }
Reporter handles component status reporting
func NewReporter ¶ added in v0.91.0
func NewReporter(onStatusChange NotifyStatusFunc, onInvalidTransition InvalidTransitionFunc) Reporter
NewReporter returns a reporter that will invoke the NotifyStatusFunc when a component's status has changed.
type ServiceStatusFunc ¶
type ServiceStatusFunc func(*component.InstanceID, *component.StatusEvent)
ServiceStatusFunc is the expected type of ReportStatus
Click to show internal directories.
Click to hide internal directories.