notifydata

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 3 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 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) 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, Manifst.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) OverallStatus added in v0.19.0

func (m MultiSnapshotStatus) OverallStatus() string

OverallStatus returns the overall status of the snapshots.

Jump to

Keyboard shortcuts

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