backup

package
v0.0.0-...-6fbd81c Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backuper

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

func NewBackuper

func NewBackuper(
	filesRepository RemoteFilesRepository,
	eChecker ExistentFilesChecker,
	config Config,
) Backuper

func (Backuper) Upload

func (h Backuper) Upload(ctx context.Context, errChan chan error) error

type Checker

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

func NewChecker

func NewChecker(filesRepository RemoteFilesRepository, cfg Config) *Checker

func (*Checker) Add

func (h *Checker) Add(path string, uploadedAt time.Time)

func (*Checker) Close

func (h *Checker) Close(ctx context.Context) error

func (*Checker) Exists

func (h *Checker) Exists(path string, lastUpdate time.Time) bool

func (*Checker) GetFiles

func (h *Checker) GetFiles() map[string]time.Time

func (*Checker) Ignored

func (h *Checker) Ignored() int

func (Checker) Open

func (h Checker) Open(ctx context.Context) error

func (*Checker) Remove

func (h *Checker) Remove(path string)

func (*Checker) Uploaded

func (h *Checker) Uploaded() int

type Config

type Config struct {
	PathsToBackup   []string          `yaml:"pathsToBackup"`
	IgnoredPatterns []string          `yaml:"ignoredPatterns"`
	SelectedRemote  string            `yaml:"selectedRemote"`
	Remotes         map[string]Remote `yaml:"remotes"`
	GlacierPath     string
}

type ConfigDecoder

type ConfigDecoder struct {
}

func NewConfigDecoder

func NewConfigDecoder() *ConfigDecoder

func (ConfigDecoder) LoadConfiguration

func (cd ConfigDecoder) LoadConfiguration() (Config, error)

type ExistentFilesChecker

type ExistentFilesChecker interface {
	Open(ctx context.Context) error
	Add(path string, uploadedAt time.Time)
	Remove(path string)
	Exists(path string, lastUpdated time.Time) bool
	Close(ctx context.Context) error
}

type FileNotFoundError

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

func NewFileNotFoundError

func NewFileNotFoundError(filePath string) FileNotFoundError

func (FileNotFoundError) Error

func (f FileNotFoundError) Error() string

type Remote

type Remote struct {
	CustomConfig map[string]string `yaml:"customConfig"`
}

type RemoteFilesRepository

type RemoteFilesRepository interface {
	PutGlacier(ctx context.Context, localPath string) error
	PutEditable(ctx context.Context, localPath string, remotePath string) error
	Delete(ctx context.Context, remotePath string) error
	Get(ctx context.Context, remotePath string) (string, error)
}

Directories

Path Synopsis
implementations
s3

Jump to

Keyboard shortcuts

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