types

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package types defines shared application data types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupInfo

type BackupInfo struct {
	// Backup timestamp
	Timestamp time.Time

	// Backup file name
	Filename string

	// File size in bytes
	Size int64

	// SHA256 checksum
	Checksum string

	// Compression type used
	Compression CompressionType

	// Full file path
	Path string

	// Proxmox environment type
	ProxmoxType ProxmoxType
}

BackupInfo contains information about a backup.

type BackupMetadata

type BackupMetadata struct {
	// BackupFile is the full path to the backup file
	BackupFile string

	// Timestamp is when the backup was created
	Timestamp time.Time

	// Size is the file size in bytes
	Size int64

	// Checksum is the SHA256 checksum of the backup file
	Checksum string

	// ProxmoxType is the type of Proxmox environment (PVE/PBS)
	ProxmoxType ProxmoxType

	// Compression is the compression type used
	Compression CompressionType

	// Version is the backup format version
	Version string
}

BackupMetadata contains metadata about a backup file Used by storage backends to track backup files

type CompressionType

type CompressionType string

CompressionType represents the compression type.

const (
	// CompressionGzip - gzip compression
	CompressionGzip CompressionType = "gz"

	// CompressionPigz - parallel gzip compression (pigz)
	CompressionPigz CompressionType = "pigz"

	// CompressionBzip2 - bzip2 compression
	CompressionBzip2 CompressionType = "bz2"

	// CompressionXZ - xz compression (LZMA)
	CompressionXZ CompressionType = "xz"

	// CompressionLZMA - classic lzma compression
	CompressionLZMA CompressionType = "lzma"

	// CompressionZstd - zstd compression
	CompressionZstd CompressionType = "zst"

	// CompressionNone - no compression
	CompressionNone CompressionType = "none"
)

func (CompressionType) String

func (c CompressionType) String() string

String returns the string representation of the compression type.

type ExitCode

type ExitCode int

ExitCode represents the application's exit codes.

const (
	// ExitSuccess - Execution completed successfully.
	ExitSuccess ExitCode = 0

	// ExitGenericError - Unspecified generic error.
	ExitGenericError ExitCode = 1

	// ExitConfigError - Configuration error.
	ExitConfigError ExitCode = 2

	// ExitEnvironmentError - Invalid or unsupported Proxmox environment.
	ExitEnvironmentError ExitCode = 3

	// ExitBackupError - Error during the backup operation (generic).
	ExitBackupError ExitCode = 4

	// ExitStorageError - Error during storage operations.
	ExitStorageError ExitCode = 5

	// ExitNetworkError - Network error (upload, notifications, etc.).
	ExitNetworkError ExitCode = 6

	// ExitPermissionError - Permission error.
	ExitPermissionError ExitCode = 7

	// ExitVerificationError - Error during integrity verification.
	ExitVerificationError ExitCode = 8

	// ExitCollectionError - Error during collection of configuration files.
	ExitCollectionError ExitCode = 9

	// ExitArchiveError - Error while creating the archive.
	ExitArchiveError ExitCode = 10

	// ExitCompressionError - Error during compression.
	ExitCompressionError ExitCode = 11

	// ExitDiskSpaceError - Insufficient disk space.
	ExitDiskSpaceError ExitCode = 12

	// ExitPanicError - Unhandled panic caught.
	ExitPanicError ExitCode = 13

	// ExitSecurityError - Errors detected by the security check.
	ExitSecurityError ExitCode = 14
)

func (ExitCode) Int

func (e ExitCode) Int() int

Int returns the exit code as an integer.

func (ExitCode) String

func (e ExitCode) String() string

String returns a human-readable description of the exit code.

type LogLevel

type LogLevel int

LogLevel represents the logging level.

const (
	// LogLevelDebug - Debug logs (maximum detail)
	LogLevelDebug LogLevel = 5

	// LogLevelInfo - General information
	LogLevelInfo LogLevel = 4

	// LogLevelWarning - Warnings
	LogLevelWarning LogLevel = 3

	// LogLevelError - Errors
	LogLevelError LogLevel = 2

	// LogLevelCritical - Critical errors
	LogLevelCritical LogLevel = 1

	// LogLevelNone - No logs
	LogLevelNone LogLevel = 0
)

func (LogLevel) String

func (l LogLevel) String() string

String returns the string representation of the log level.

type ProxmoxType

type ProxmoxType string

ProxmoxType represents the type of Proxmox environment.

const (
	// ProxmoxVE - Proxmox Virtual Environment
	ProxmoxVE ProxmoxType = "pve"

	// ProxmoxBS - Proxmox Backup Server
	ProxmoxBS ProxmoxType = "pbs"

	// ProxmoxUnknown - Unknown or undetected type
	ProxmoxUnknown ProxmoxType = "unknown"
)

func (ProxmoxType) String

func (p ProxmoxType) String() string

String returns the string representation of the Proxmox type.

type StorageLocation

type StorageLocation string

StorageLocation represents a storage destination.

const (
	// StorageLocal - Local storage
	StorageLocal StorageLocation = "local"

	// StorageSecondary - Secondary storage
	StorageSecondary StorageLocation = "secondary"

	// StorageCloud - Cloud storage (rclone)
	StorageCloud StorageLocation = "cloud"
)

func (StorageLocation) String

func (s StorageLocation) String() string

String returns the string representation of the location.

Jump to

Keyboard shortcuts

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