Documentation
¶
Overview ¶
Package storage defines the interface for backup storage backends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrArchiveNotFound is returned when archive file doesn't exist. ErrArchiveNotFound = errors.New("archive not found") // ErrArchiveIsDirectory is returned when archive path points to a directory. ErrArchiveIsDirectory = errors.New("archive path is a directory") // ErrArchiveEmpty is returned when archive file is empty. ErrArchiveEmpty = errors.New("archive is empty") )
Functions ¶
func ValidateArchive ¶ added in v1.16.0
ValidateArchive validates that a file is a valid tar.gz archive. It checks the file exists, is readable, and has valid gzip/tar format. It does NOT extract the archive.
Types ¶
type Archive ¶ added in v1.16.0
type Archive struct {
// Path is the local filesystem path or S3 key.
Path string
// StorageType indicates where the archive is stored (local or s3).
StorageType string
// Size is the archive file size in bytes.
Size int64
// ChecksumMD5 is the archive integrity checksum.
ChecksumMD5 string
// Contents is the extracted archive structure.
Contents *ArchiveContents
}
Archive represents a backup archive created by gitlab-backup.
type ArchiveContents ¶ added in v1.16.0
type ArchiveContents struct {
// ProjectExportPath is the path to GitLab native export archive.
ProjectExportPath string
// ExtractionDir is the temporary directory (unused but kept for API compatibility).
ExtractionDir string
}
ArchiveContents represents the contents of a backup archive.
func ExtractArchive ¶ added in v1.16.0
func ExtractArchive(ctx context.Context, archivePath string, destDir string) (*ArchiveContents, error)
ExtractArchive validates and returns the archive path for GitLab import. All archives created by gitlab-backup are direct GitLab exports and require no extraction.
Returns ArchiveContents with the archive path. The context is checked for cancellation before validation for consistency with other operations.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package localstorage provides local file system storage implementation.
|
Package localstorage provides local file system storage implementation. |
|
Package s3storage provides AWS S3 storage implementation.
|
Package s3storage provides AWS S3 storage implementation. |
Click to show internal directories.
Click to hide internal directories.