Documentation
¶
Index ¶
- type Opt
- func WithAccessTier(tier string) Opt
- func WithCalculateTotalSize() Opt
- func WithChunkSize(bytes int) Opt
- func WithDir(path string) Opt
- func WithDirList(pathList []string) Opt
- func WithFile(path string) Opt
- func WithFileList(pathList []string) Opt
- func WithLogger(logger *slog.Logger) Opt
- func WithNestedDir() Opt
- func WithRemoveFiles() Opt
- func WithRetryPolicy(policy *models.RetryPolicy) Opt
- func WithSkipDirCheck() Opt
- func WithSorting() Opt
- func WithStartAfter(v string) Opt
- func WithStorageClass(class string) Opt
- func WithUploadConcurrency(v int) Opt
- func WithValidator(v validator) Opt
- func WithWarmPollDuration(duration time.Duration) Opt
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opt ¶
type Opt func(*Options)
func WithAccessTier ¶
WithAccessTier sets the access tier for archived files. For readers, archived files are restored to the specified tier.
func WithCalculateTotalSize ¶
func WithCalculateTotalSize() Opt
WithCalculateTotalSize determines whether we need to calculate the total size of all files in a path. Is used only for Reader.
func WithChunkSize ¶
WithChunkSize sets the chunk size for uploading files. Is used only for Writer.
func WithDirList ¶
WithDirList adds the directory list to read files from. Is used only for Reader.
func WithFileList ¶
WithFileList adds the file list to read from. Is used only for Reader.
func WithNestedDir ¶
func WithNestedDir() Opt
WithNestedDir adds WithNestedDir = true parameter. That means that we won't skip nested folders.
func WithRemoveFiles ¶
func WithRemoveFiles() Opt
WithRemoveFiles adds remove files flag, so all files will be removed from backup folder before backup. Is used only for Writer.
func WithRetryPolicy ¶
func WithRetryPolicy(policy *models.RetryPolicy) Opt
WithRetryPolicy sets the retry policy. Is used only for S3 Reader.
func WithSkipDirCheck ¶
func WithSkipDirCheck() Opt
WithSkipDirCheck adds skip dir check flags. Which means that backup directory won't be checked for emptiness.
func WithSorting ¶
func WithSorting() Opt
WithSorting adds a sorting flag. Which means that files will be read from directory in the sorted order. Is used only for Reader.
func WithStartAfter ¶
WithStartAfter adds start after parameter to list request. Is used only for Reader.
func WithStorageClass ¶
WithStorageClass sets the storage class. For writers, files are saved to the specified class (in case of Azure it will be tier).
func WithUploadConcurrency ¶
WithUploadConcurrency defines max number of concurrent uploads to be performed to upload the file. Is used only for Azure Writer.
func WithValidator ¶
func WithValidator(v validator) Opt
WithValidator adds the Validator to Reader, so files will be validated before reading. Is used only for Reader.
func WithWarmPollDuration ¶
WithWarmPollDuration sets the restore status polling interval.
type Options ¶
type Options struct {
// PathList contains a list of files or directories.
PathList []string
// IsDir flag determines whether the path is a directory.
IsDir bool
// IsRemovingFiles flag specifies whether to clear the backup folder.
IsRemovingFiles bool
// Validator contains files Validator that is applied to files if IsDir is true.
Validator validator
// WithNestedDir determines whether the read/write operations should treat objects
// identified as directories like regular files.
// When we stream files or delete files in folder, we skip directories. Setting
// WithNestedDir to true disables this directory skipping behavior.
// Default: false
WithNestedDir bool
// StartAfter is an artificial parameter. Used to skip objects in the storage.
// The Result will not include an object specified in startAfter.
// If it is set, then we compare the names received from the storage lexicographically,
// and if the name is less than the specified parameter, we skip this object.
StartAfter string
// SkipDirCheck, if true, the backup directory won't be checked.
SkipDirCheck bool
// SortFiles determines whether we need to sort files before reading.
SortFiles bool
// UploadConcurrency defines the max number of concurrent uploads to be performed to
// upload the file. Each concurrent upload will create a buffer of size BlockSize.
UploadConcurrency int
// StorageClass specifies the type of storage class.
// Supported values depend on the cloud provider being used.
StorageClass string
// The access tier that will be applied to back up files.
AccessTier string
// Logger contains logger.
Logger *slog.Logger
// How often restore status will be polled from cloud provider.
PollWarmDuration time.Duration
// Size of chunk to upload.
ChunkSize int
// RetryPolicy is used to control the number of retries for failed requests.
// At the moment supported only for S3 Reader.
RetryPolicy *models.RetryPolicy
// CalculateTotalSize determines whether we need to calculate the total size of all files in a path on Reader creation.
CalculateTotalSize bool
}