Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
func Copy( ctx context.Context, provider storage.StorageProvider, spec model.StorageSpec, destination model.StorageSourceType, ) (model.StorageSpec, error)
Copy transfers data described by the passed StorageSpec into the destination type, and returns a new StorageSpec for the data in its new location.
func CopyOversize ¶
func CopyOversize( ctx context.Context, provider storage.StorageProvider, specs []*model.StorageSpec, srcType, dstType model.StorageSourceType, maxSingle, maxTotal datasize.ByteSize, ) (modified bool, err 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.