server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lister

type Lister struct {
	// contains filtered or unexported fields
}

Lister lists all backups in the given path.

func NewLister

func NewLister(
	reader backup.StreamingReader,
	logger *slog.Logger,
	toLog bool,
) *Lister

NewLister creates a new backup Lister.

type ListerV2

type ListerV2 struct {
	// contains filtered or unexported fields
}

ListerV2 provides functionality to list backups from an S3 bucket. As development is ongoing, this is a work-in-progress, and may change. It supports listing all snapshots in a given prefix, or a single snapshot. The concurrency level can be configured, and the output can be logged or rendered to stderr. The logger is used for logging, and stderr is used for rendering.

func NewListerV2

func NewListerV2(client S3API, bucket, prefix string, toLog bool, writer io.Writer, logger *slog.Logger) *ListerV2

NewListerV2 creates a new backup ListerV2.

func (*ListerV2) FetchAllMetadata

func (l *ListerV2) FetchAllMetadata(ctx context.Context) error

FetchAllMetadata lists all metadata files in the given prefix.

type S3API

type S3API interface {
	ListObjectsV2(ctx context.Context, in *s3.ListObjectsV2Input, opts ...func(*s3.Options),
	) (*s3.ListObjectsV2Output, error)
	GetObject(ctx context.Context, in *s3.GetObjectInput, opts ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

S3API is an interface for the S3 client.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service represents a server integrated backup and restore service.

func NewService

func NewService(
	ctx context.Context,
	cfg *config.ServerBackupServiceConfig,
	logger *slog.Logger,
) (*Service, error)

NewService initializes and returns a new Service instance.

func (*Service) GetStatus

func (s *Service) GetStatus(ctx context.Context) error

func (*Service) ListBackups

func (s *Service) ListBackups(ctx context.Context) error

func (*Service) ListBackupsV2

func (s *Service) ListBackupsV2(ctx context.Context) error

func (*Service) PrepareRestore

func (s *Service) PrepareRestore(ctx context.Context) error

PrepareRestore initiates a restore preparation process for the specified job ID.

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

func (*Service) StartBackup

func (s *Service) StartBackup(ctx context.Context) error

StartBackup initiates a backup process using the service's configured backup settings and returns an error if it fails.

func (*Service) StartRestore

func (s *Service) StartRestore(ctx context.Context) error

StartRestore initiates a restore process for the specified job ID using the service's backup configuration.

Jump to

Keyboard shortcuts

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