support

package
v0.0.0-...-880cb89 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionMetrics

type CollectionMetrics struct {
	Objects, Successes int
	Bytes              int64
}

func CombineMetrics

func CombineMetrics(a, b CollectionMetrics) CollectionMetrics

type ControllerOperationStatus

type ControllerOperationStatus struct {
	Folders int
	Metrics CollectionMetrics
	// contains filtered or unexported fields
}

ControllerOperationStatus is a data type used to describe the state of the sequence of operations. @param ObjectCount integer representation of how many objects have downloaded or uploaded. @param Successful: Number of objects that are sent through the connector without incident. @param incomplete: Bool representation of whether all intended items were download or uploaded. @param bytes: represents the total number of bytes that have been downloaded or uploaded.

func CreateStatus

func CreateStatus(
	ctx context.Context,
	op Operation,
	folders int,
	cm CollectionMetrics,
	details string,
) *ControllerOperationStatus

Constructor for ConnectorOperationStatus. If the counts do not agree, an error is returned.

func MergeStatus

MergeStatus combines ConnectorOperationsStatus value into a single status

func (*ControllerOperationStatus) String

func (cos *ControllerOperationStatus) String() string

func (ControllerOperationStatus) ToCollectionStats

func (cos ControllerOperationStatus) ToCollectionStats() *data.CollectionStats

ToCollectionStats turns the called ControllerOperationStatus into a *data.CollectionStats instance

TODO(ashmrtn): Remove this when we rework status handling. It's really here to avoid repeated code in each service handler.

type Operation

type Operation int
const (
	OpUnknown Operation = 0
	Backup    Operation = 1
	Restore   Operation = 2
	Export    Operation = 3
)

func (Operation) String

func (i Operation) String() string

type StatusUpdater

type StatusUpdater func(*ControllerOperationStatus)

Function signature for a status updater Used to define a function that an async connector task can call to on completion with its ConnectorOperationStatus

Jump to

Keyboard shortcuts

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