types

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupMetadata

type BackupMetadata struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Size        int64             `json:"size"`
	CreatedAt   time.Time         `json:"created_at"`
	Tags        map[string]string `json:"tags,omitempty"`
	Description string            `json:"description,omitempty"`
}

BackupMetadata contains metadata about a backup

type BackupOptions

type BackupOptions struct {
	Compression bool              `json:"compression"`
	Encryption  bool              `json:"encryption"`
	Tags        map[string]string `json:"tags,omitempty"`
	Description string            `json:"description,omitempty"`
}

BackupOptions contains options for backup operations

type Manager

type Manager interface {
	// SetProvider sets the backup provider
	SetProvider(provider Provider)

	// GetProvider returns the current backup provider
	GetProvider() Provider

	// CreateBackup creates a backup using the current provider
	CreateBackup(ctx context.Context, name string, data io.Reader, opts *BackupOptions) (*BackupMetadata, error)

	// RestoreBackup restores a backup using the current provider
	RestoreBackup(ctx context.Context, backupID string, writer io.Writer, opts *RestoreOptions) error

	// ListBackups lists all available backups
	ListBackups(ctx context.Context) ([]*BackupMetadata, error)

	// GetBackup retrieves backup metadata
	GetBackup(ctx context.Context, backupID string) (*BackupMetadata, error)

	// DeleteBackup removes a backup
	DeleteBackup(ctx context.Context, backupID string) error

	// HealthCheck checks if the current provider is healthy
	HealthCheck(ctx context.Context) error
}

Manager defines the interface for backup management

type Provider

type Provider interface {
	// CreateBackup creates a backup from the given data
	CreateBackup(ctx context.Context, name string, data io.Reader, opts *BackupOptions) (*BackupMetadata, error)

	// RestoreBackup restores a backup to the given writer
	RestoreBackup(ctx context.Context, backupID string, writer io.Writer, opts *RestoreOptions) error

	// ListBackups lists all available backups
	ListBackups(ctx context.Context) ([]*BackupMetadata, error)

	// GetBackup retrieves backup metadata
	GetBackup(ctx context.Context, backupID string) (*BackupMetadata, error)

	// DeleteBackup removes a backup
	DeleteBackup(ctx context.Context, backupID string) error

	// HealthCheck checks if the provider is healthy
	HealthCheck(ctx context.Context) error
}

Provider defines the interface for backup providers

type RestoreOptions

type RestoreOptions struct {
	Overwrite bool `json:"overwrite"`
}

RestoreOptions contains options for restore operations

Jump to

Keyboard shortcuts

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