status

package
v0.99.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

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, 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) Ready added in v0.91.0

func (r *Reporter) Ready()

Ready enables status reporting

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL