Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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, which differs from servicetelemetry.Settings in that the component version is tied to specific component instance.
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 struct {
// contains filtered or unexported fields
}
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.
func (*Reporter) ReportOKIfStarting ¶ added in v0.92.0
func (r *Reporter) ReportOKIfStarting(id *component.InstanceID)
func (*Reporter) ReportStatus ¶ added in v0.92.0
func (r *Reporter) ReportStatus( id *component.InstanceID, ev *component.StatusEvent, )
ReportStatus reports status for the given InstanceID
type ServiceStatusFunc ¶
type ServiceStatusFunc func(*component.InstanceID, *component.StatusEvent)
ServiceStatusFunc is the expected type of ReportStatus for servicetelemetry.Settings