Documentation
¶
Overview ¶
Package notifydata contains the data structures used by the notification package.
Index ¶
- Constants
- type EmptyEventData
- type ErrorInfo
- type ManifestWithError
- func (m *ManifestWithError) Duration() time.Duration
- func (m *ManifestWithError) EndTimestamp() time.Time
- func (m *ManifestWithError) StartTimestamp() time.Time
- func (m *ManifestWithError) StatusCode() string
- func (m *ManifestWithError) TotalDirs() int64
- func (m *ManifestWithError) TotalDirsDelta() int64
- func (m *ManifestWithError) TotalFiles() int64
- func (m *ManifestWithError) TotalFilesDelta() int64
- func (m *ManifestWithError) TotalSize() int64
- func (m *ManifestWithError) TotalSizeDelta() int64
- type MultiSnapshotStatus
- type TypedEventArgs
Constants ¶
const ( StatusCodeIncomplete = "incomplete" StatusCodeFatal = "fatal" StatusCodeWarnings = "warnings" StatusCodeSuccess = "success" )
Status codes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyEventData ¶ added in v0.20.1
type EmptyEventData struct{}
EmptyEventData is a placeholder for events that do not carry any additional data.
func (EmptyEventData) EventArgsType ¶ added in v0.20.1
func (e EmptyEventData) EventArgsType() grpcapi.NotificationEventArgType
EventArgsType returns the type of event arguments for EmptyEventData.
type ErrorInfo ¶
type ErrorInfo struct {
Operation string `json:"operation"`
OperationDetails string `json:"operationDetails"`
StartTime time.Time `json:"start"`
EndTime time.Time `json:"end"`
ErrorMessage string `json:"error"`
ErrorDetails string `json:"errorDetails"`
}
ErrorInfo represents information about errors.
func NewErrorInfo ¶
func NewErrorInfo(operation, operationDetails string, startTime, endTime time.Time, err error) *ErrorInfo
NewErrorInfo creates a new ErrorInfo.
func (*ErrorInfo) EndTimestamp ¶
EndTimestamp returns the end time of the operation that caused the error.
func (*ErrorInfo) EventArgsType ¶ added in v0.20.1
func (e *ErrorInfo) EventArgsType() grpcapi.NotificationEventArgType
EventArgsType returns the type of event arguments for ErrorInfo.
func (*ErrorInfo) StartTimestamp ¶
StartTimestamp returns the start time of the operation that caused the error.
type ManifestWithError ¶
type ManifestWithError struct {
Manifest snapshot.Manifest `json:"manifest"` // may not be filled out if there was an error, Manifest.Source is always set.
Previous *snapshot.Manifest `json:"previous"` // may not be filled out
Error string `json:"error"` // will be present if there was an error
}
ManifestWithError represents information about the snapshot manifest with optional error.
func (*ManifestWithError) Duration ¶
func (m *ManifestWithError) Duration() time.Duration
Duration returns the duration of the snapshot.
func (*ManifestWithError) EndTimestamp ¶
func (m *ManifestWithError) EndTimestamp() time.Time
EndTimestamp returns the end time of the snapshot.
func (*ManifestWithError) StartTimestamp ¶
func (m *ManifestWithError) StartTimestamp() time.Time
StartTimestamp returns the start time of the snapshot.
func (*ManifestWithError) StatusCode ¶
func (m *ManifestWithError) StatusCode() string
StatusCode returns the status code of the manifest.
func (*ManifestWithError) TotalDirs ¶
func (m *ManifestWithError) TotalDirs() int64
TotalDirs returns the total number of directories in the snapshot.
func (*ManifestWithError) TotalDirsDelta ¶
func (m *ManifestWithError) TotalDirsDelta() int64
TotalDirsDelta returns the total number of new directories in the snapshot.
func (*ManifestWithError) TotalFiles ¶
func (m *ManifestWithError) TotalFiles() int64
TotalFiles returns the total number of files in the snapshot.
func (*ManifestWithError) TotalFilesDelta ¶
func (m *ManifestWithError) TotalFilesDelta() int64
TotalFilesDelta returns the total number of new files in the snapshot.
func (*ManifestWithError) TotalSize ¶
func (m *ManifestWithError) TotalSize() int64
TotalSize returns the total size of the snapshot in bytes.
func (*ManifestWithError) TotalSizeDelta ¶
func (m *ManifestWithError) TotalSizeDelta() int64
TotalSizeDelta returns the total size of the snapshot in bytes.
type MultiSnapshotStatus ¶
type MultiSnapshotStatus struct {
Snapshots []*ManifestWithError `json:"snapshots"`
}
MultiSnapshotStatus represents the status of multiple snapshots.
func (MultiSnapshotStatus) EventArgsType ¶ added in v0.20.1
func (m MultiSnapshotStatus) EventArgsType() grpcapi.NotificationEventArgType
EventArgsType returns the type of event arguments for MultiSnapshotStatus.
func (MultiSnapshotStatus) OverallStatus ¶ added in v0.19.0
func (m MultiSnapshotStatus) OverallStatus() string
OverallStatus returns the overall status of the snapshots.
func (MultiSnapshotStatus) OverallStatusCode ¶ added in v0.20.1
func (m MultiSnapshotStatus) OverallStatusCode() string
OverallStatusCode returns the overall status of the snapshots (StatusCodeSuccess, StatusCodeWarnings, or StatusCodeFatal).
type TypedEventArgs ¶ added in v0.20.1
type TypedEventArgs interface {
// EventArgsType returns the type of event arguments.
EventArgsType() grpcapi.NotificationEventArgType
}
TypedEventArgs is an interface that represents the event arguments for notifications.
func UnmarshalEventArgs ¶ added in v0.20.1
func UnmarshalEventArgs(data []byte, notificationEventArgType grpcapi.NotificationEventArgType) (TypedEventArgs, error)
UnmarshalEventArgs unmarshals the provided JSON data into a TypedEventArgs based on the specified notificationEventArgType.