archive

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupOldArchives

func CleanupOldArchives(retentionCount int) (int, error)

CleanupOldArchives removes old archives based on retention policy

func DeleteArchive

func DeleteArchive(archivePath string) error

DeleteArchive removes an archive file

func ExportAllEnvironments

func ExportAllEnvironments(outputPath string) error

ExportAllEnvironments exports all environments to a single archive or directory

func ExportEnvironment

func ExportEnvironment(envName, outputPath string) error

ExportEnvironment exports a single environment to a file

func ExportEnvironments

func ExportEnvironments(envNames []string, outputDir string) error

ExportEnvironments exports multiple specific environments

func GetArchiveDir

func GetArchiveDir() (string, error)

GetArchiveDir returns the path to the archive directory

func ImportAll

func ImportAll(dirPath string, force bool) error

ImportAll imports all archives from a directory

func ImportEnvironment

func ImportEnvironment(archivePath string, options ImportOptions) error

ImportEnvironment imports an environment from an archive file

func RestoreArchive

func RestoreArchive(archivePath, destPath string) error

RestoreArchive extracts an archived environment (for future use)

Types

type Archive

type Archive struct {
	Path        string
	EnvName     string
	ArchivedAt  time.Time
	OriginalEnv *environment.Environment
}

Archive represents an archived environment

func ArchiveEnvironment

func ArchiveEnvironment(env *environment.Environment) (*Archive, error)

ArchiveEnvironment creates a compressed archive of an environment before deletion

func ListArchives

func ListArchives() ([]*Archive, error)

ListArchives returns all archived environments

type ExportOptions

type ExportOptions struct {
	OutputPath string   // Path to output file
	EnvNames   []string // Specific environments to export (empty = all)
	All        bool     // Export all environments
}

ExportOptions defines options for exporting environments

type ImportOptions

type ImportOptions struct {
	ArchivePath string // Path to archive file
	NewName     string // Optional: new name for the environment
	Force       bool   // Overwrite existing environment
}

ImportOptions defines options for importing environments

Jump to

Keyboard shortcuts

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