notifydata

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package notifydata contains the data structures used by the notification package.

Index

Constants

View Source
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

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) Duration

func (e *ErrorInfo) Duration() time.Duration

Duration returns the duration of the operation.

func (*ErrorInfo) EndTimestamp

func (e *ErrorInfo) EndTimestamp() time.Time

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

func (e *ErrorInfo) StartTimestamp() time.Time

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

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.

Jump to

Keyboard shortcuts

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