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 *componentstatus.InstanceID, srvStatus ServiceStatusFunc, ) func(*componentstatus.Event)
NewReportStatusFunc returns a function to be used as ReportStatus for componentstatus.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(*componentstatus.InstanceID, *componentstatus.Event)
NotifyStatusFunc is the receiver of status events after successful state transitions
type Reporter ¶ added in v0.91.0
type Reporter interface { ReportStatus(id *componentstatus.InstanceID, ev *componentstatus.Event) ReportOKIfStarting(id *componentstatus.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(*componentstatus.InstanceID, *componentstatus.Event)
ServiceStatusFunc is the expected type of ReportStatus
Click to show internal directories.
Click to hide internal directories.