Documentation
¶
Index ¶
- Variables
- func ApplyRetention(ctx context.Context, storage Storage, job *config.JobConfig, ...) error
- func InvalidateSetCache(jobName, storageName string)
- func JobDirLocal(basePath, jobName string) string
- func JobDirPosix(basePath, jobName string) string
- func JobNameSegment(includeJobName *bool, jobName string) string
- func ParseSplitWrapper(name string) (base string, parts int, totalSize int64, ok bool)
- func SplitWrapperName(archiveName string, partsCount int, totalSize int64) string
- type BackupSet
- type BunnyStorage
- func (b *BunnyStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, ...) error
- func (b *BunnyStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) error
- func (b *BunnyStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, ...) (*DownloadResult, error)
- func (b *BunnyStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
- func (b *BunnyStorage) GetType() string
- func (b *BunnyStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
- func (b *BunnyStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) ([]FileInfo, error)
- func (b *BunnyStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, ...) error
- type DownloadResult
- type Downloader
- type Factory
- type FileInfo
- type LocalStorage
- func (l *LocalStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, ...) error
- func (l *LocalStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) error
- func (l *LocalStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, ...) (*DownloadResult, error)
- func (l *LocalStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
- func (l *LocalStorage) GetType() string
- func (l *LocalStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
- func (l *LocalStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) ([]FileInfo, error)
- func (l *LocalStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, ...) error
- type S3Storage
- func (s *S3Storage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, ...) error
- func (s *S3Storage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) error
- func (s *S3Storage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, ...) (*DownloadResult, error)
- func (s *S3Storage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
- func (s *S3Storage) GetType() string
- func (s *S3Storage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
- func (s *S3Storage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) ([]FileInfo, error)
- func (s *S3Storage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, ...) error
- type SFTPStorage
- func (s *SFTPStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, ...) error
- func (s *SFTPStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) error
- func (s *SFTPStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, ...) (*DownloadResult, error)
- func (s *SFTPStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
- func (s *SFTPStorage) GetType() string
- func (s *SFTPStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
- func (s *SFTPStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) ([]FileInfo, error)
- func (s *SFTPStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, ...) error
- type Storage
- type WebDAVStorage
- func (w *WebDAVStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, ...) error
- func (w *WebDAVStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) error
- func (w *WebDAVStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, ...) (*DownloadResult, error)
- func (w *WebDAVStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
- func (w *WebDAVStorage) GetType() string
- func (w *WebDAVStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
- func (w *WebDAVStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, ...) ([]FileInfo, error)
- func (w *WebDAVStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, ...) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDownloadNotSupported = errors.New("storage does not support download")
Functions ¶
func ApplyRetention ¶
func InvalidateSetCache ¶
func InvalidateSetCache(jobName, storageName string)
func JobDirLocal ¶
func JobDirPosix ¶
func JobNameSegment ¶ added in v0.1.4
JobNameSegment returns the job-name path segment to append to a storage's base path, honouring storage.IncludeJobName (nil/true → append, false → skip).
func ParseSplitWrapper ¶
Types ¶
type BackupSet ¶
type BackupSet struct {
ID string
Files []FileInfo
LastModified time.Time
TotalSize int64
IsSplit bool
PartsCount int
WrapperName string
}
BackupSet is one logical snapshot. For split snapshots Files is nil — parts inside the wrapper are listed only on demand.
func GroupBackupSets ¶
type BunnyStorage ¶
type BunnyStorage struct {
// contains filtered or unexported fields
}
func NewBunnyStorage ¶
func NewBunnyStorage() *BunnyStorage
func (*BunnyStorage) DeleteFile ¶
func (b *BunnyStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, storage pkgconfig.StorageConfig) error
func (*BunnyStorage) DeleteWrapper ¶
func (b *BunnyStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) error
func (*BunnyStorage) Download ¶
func (b *BunnyStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, storage pkgconfig.StorageConfig) (*DownloadResult, error)
func (*BunnyStorage) EnsureJobDir ¶
func (b *BunnyStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
func (*BunnyStorage) GetType ¶
func (b *BunnyStorage) GetType() string
func (*BunnyStorage) ListFiles ¶
func (b *BunnyStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*BunnyStorage) ListWrapperParts ¶
func (b *BunnyStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*BunnyStorage) UploadInto ¶
func (b *BunnyStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, wrapperRelDir string, storage pkgconfig.StorageConfig) error
type DownloadResult ¶
type DownloadResult struct {
Body io.ReadCloser
Size int64
RedirectURL string
}
DownloadResult: exactly one of Body or RedirectURL is set.
type Downloader ¶
type Downloader interface {
Download(ctx context.Context, job *config.JobConfig, wrapperRelDir, fileName string, storage config.StorageConfig) (*DownloadResult, error)
}
Downloader is optional. Storages without it return ErrDownloadNotSupported.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func NewFactory() *Factory
type LocalStorage ¶
type LocalStorage struct{}
func NewLocalStorage ¶
func NewLocalStorage() *LocalStorage
func (*LocalStorage) DeleteFile ¶
func (l *LocalStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, storage pkgconfig.StorageConfig) error
func (*LocalStorage) DeleteWrapper ¶
func (l *LocalStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) error
func (*LocalStorage) Download ¶
func (l *LocalStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, storage pkgconfig.StorageConfig) (*DownloadResult, error)
func (*LocalStorage) EnsureJobDir ¶
func (l *LocalStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
func (*LocalStorage) GetType ¶
func (l *LocalStorage) GetType() string
func (*LocalStorage) ListFiles ¶
func (l *LocalStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*LocalStorage) ListWrapperParts ¶
func (l *LocalStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*LocalStorage) UploadInto ¶
func (l *LocalStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, wrapperRelDir string, storage pkgconfig.StorageConfig) error
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
func NewS3Storage ¶
func NewS3Storage() *S3Storage
func (*S3Storage) DeleteFile ¶
func (*S3Storage) DeleteWrapper ¶
func (*S3Storage) Download ¶
func (s *S3Storage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, storage pkgconfig.StorageConfig) (*DownloadResult, error)
func (*S3Storage) EnsureJobDir ¶
func (*S3Storage) ListWrapperParts ¶
type SFTPStorage ¶
type SFTPStorage struct{}
func NewSFTPStorage ¶
func NewSFTPStorage() *SFTPStorage
func (*SFTPStorage) DeleteFile ¶
func (s *SFTPStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, storage pkgconfig.StorageConfig) error
func (*SFTPStorage) DeleteWrapper ¶
func (s *SFTPStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) error
func (*SFTPStorage) Download ¶
func (s *SFTPStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, storage pkgconfig.StorageConfig) (*DownloadResult, error)
func (*SFTPStorage) EnsureJobDir ¶
func (s *SFTPStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
func (*SFTPStorage) GetType ¶
func (s *SFTPStorage) GetType() string
func (*SFTPStorage) ListFiles ¶
func (s *SFTPStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*SFTPStorage) ListWrapperParts ¶
func (s *SFTPStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*SFTPStorage) UploadInto ¶
func (s *SFTPStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, wrapperRelDir string, storage pkgconfig.StorageConfig) error
type Storage ¶
type Storage interface {
// EnsureJobDir is a no-op on object stores.
EnsureJobDir(ctx context.Context, job *config.JobConfig, storage config.StorageConfig) error
// UploadInto writes archivePath to <storage.Path>/<jobName>/<wrapperRelDir>/<basename>;
// wrapperRelDir is "" for non-split.
UploadInto(ctx context.Context, archivePath string, job *config.JobConfig, wrapperRelDir string, storage config.StorageConfig) error
ListFiles(ctx context.Context, job *config.JobConfig, storage config.StorageConfig) ([]FileInfo, error)
ListWrapperParts(ctx context.Context, job *config.JobConfig, wrapperName string, storage config.StorageConfig) ([]FileInfo, error)
DeleteFile(ctx context.Context, job *config.JobConfig, fileName string, storage config.StorageConfig) error
DeleteWrapper(ctx context.Context, job *config.JobConfig, wrapperName string, storage config.StorageConfig) error
GetType() string
}
type WebDAVStorage ¶
type WebDAVStorage struct{}
func NewWebDAVStorage ¶
func NewWebDAVStorage() *WebDAVStorage
func (*WebDAVStorage) DeleteFile ¶
func (w *WebDAVStorage) DeleteFile(ctx context.Context, job *pkgconfig.JobConfig, fileName string, storage pkgconfig.StorageConfig) error
func (*WebDAVStorage) DeleteWrapper ¶
func (w *WebDAVStorage) DeleteWrapper(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) error
func (*WebDAVStorage) Download ¶
func (w *WebDAVStorage) Download(ctx context.Context, job *pkgconfig.JobConfig, wrapperRelDir, fileName string, storage pkgconfig.StorageConfig) (*DownloadResult, error)
func (*WebDAVStorage) EnsureJobDir ¶
func (w *WebDAVStorage) EnsureJobDir(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) error
func (*WebDAVStorage) GetType ¶
func (w *WebDAVStorage) GetType() string
func (*WebDAVStorage) ListFiles ¶
func (w *WebDAVStorage) ListFiles(ctx context.Context, job *pkgconfig.JobConfig, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*WebDAVStorage) ListWrapperParts ¶
func (w *WebDAVStorage) ListWrapperParts(ctx context.Context, job *pkgconfig.JobConfig, wrapperName string, storage pkgconfig.StorageConfig) ([]FileInfo, error)
func (*WebDAVStorage) UploadInto ¶
func (w *WebDAVStorage) UploadInto(ctx context.Context, archivePath string, job *pkgconfig.JobConfig, wrapperRelDir string, storage pkgconfig.StorageConfig) error
Click to show internal directories.
Click to hide internal directories.