Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DataMarshalError is returned when marshaling data fails. DataMarshalError = errors.ConstError("data-marshal-error") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct { Name string ID string Message string Status string Time string Data map[string]any }
Record represents a single record of status information.
type Recorder ¶
type Recorder interface { // Record records the given status information. Record(context.Context, Record) error }
Recorder is an interface for recording status information.
func NewLogRecorder ¶
NewLogRecorder returns a new logRecorder that logs to the given logger.
type StatusHistory ¶
type StatusHistory struct {
// contains filtered or unexported fields
}
StatusHistory records status information into a generalized way.
func NewStatusHistory ¶
func NewStatusHistory(recorder Recorder) *StatusHistory
NewStatusHistory creates a new StatusHistory.
func (*StatusHistory) RecordStatus ¶
func (s *StatusHistory) RecordStatus(ctx context.Context, ns Namespace, status status.StatusInfo) error
RecordStatus records the given status information. If the status data cannot be marshalled, it will not be recorded, instead the error will be logged under the data_error key.
Click to show internal directories.
Click to hide internal directories.