copy

package
v1.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(
	ctx context.Context,
	provider storage.StorageProvider,
	spec models.InputSource,
	destination string,
) (models.InputSource, error)

Copy transfers data described by the passed SpecConfig into the destination type, and returns a new SpecConfig for the data in its new location.

func CopyOversize

func CopyOversize(
	ctx context.Context,
	provider storage.StorageProvider,
	specs []*models.InputSource,
	srcType, dstType string,
	maxSingle, maxTotal datasize.ByteSize,
) (bool, error)

CopyOversize transfers StorageSpecs from one StorageSourceType to another in order to fit the specs into the passed size limits.

A spec will be transferred if it is over the passed maxSingle size. It may be transferred if all the specs are over the passed maxTotal size, depending on how big the other specs are (bigger specs are transferred first).

The specs will be updated in place to contain the location of the new data. If any specs are not of the passed srcType, they are ignored.

Passing 0 as either limit will cause all specs to be transferred.

Types

This section is empty.

Jump to

Keyboard shortcuts

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