storage

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(model config.ModelConfig, fileKey string) (string, error)

func Run

func Run(model config.ModelConfig, archivePath string) (err error)

Run storage

Types

type Azure

type Azure struct {
	Base
	// contains filtered or unexported fields
}

Azure - Microsoft Azure Blob Storage

type: azure # Storage Account account: gobackup-test # Container name container: gobackup path: backups # Authorization https://learn.microsoft.com/en-us/azure/developer/go/azure-sdk-authentication tenant_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx client_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx client_secret: xxxxxxxxxxxxxxxxx timeout: 300

type Base

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

Base storage When `archivePath` is a directory, `fileKeys` stores files in the `archivePath` with directory prefix

type Cycler

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

type FTP

type FTP struct {
	Base
	// contains filtered or unexported fields
}

FTP storage

type: ftp path: /backups host: ftp.your-host.com port: 21 timeout: 30 username: password: tls: explicit_tls: no_check_certificate:

type FileItem

type FileItem struct {
	Filename     string    `json:"filename,omitempty"`
	Size         int64     `json:"size,omitempty"`
	LastModified time.Time `json:"last_modified,omitempty"`
}

func List

func List(model config.ModelConfig, parent string) ([]FileItem, error)

List return file list of storage

type GCS

type GCS struct {
	Base
	// contains filtered or unexported fields
}

GCS - Google Clound storage

type: gcs bucket: gobackup-test path: backups credentials: { ... } credentials_file: timeout: 300

type Local

type Local struct {
	Base
	// contains filtered or unexported fields
}

Local storage

type: local path: /data/backups

type OSS

type OSS struct {
	Base
	// contains filtered or unexported fields
}

OSS - Aliyun OSS storage

type: oss bucket: gobackup-test endpoint: oss-cn-beijing.aliyuncs.com path: / access_key_id: your-access-key-id access_key_secret: your-access-key-secret max_retries: 5 timeout: 300 threads: 1 (1 .. 100) storage_class: Archive

type Package

type Package struct {
	FileKey   string    `json:"file_key"`
	FileKeys  []string  `json:"file_keys,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

When `FileKeys` is not empty, `FileKey` is the directory

type PackageList

type PackageList []Package

type S3

type S3 struct {
	Base
	Service string
	// contains filtered or unexported fields
}

S3 - Amazon S3 storage

type: s3 bucket: gobackup-test region: us-east-1 path: backups access_key_id: your-access-key-id secret_access_key: your-secret-access-key max_retries: 5 storage_class: STANDARD_IA timeout: 300

type SCP

type SCP struct {
	Base
	SSH
	// contains filtered or unexported fields
}

SCP storage

type: scp

type SFTP

type SFTP struct {
	Base
	SSH
	// contains filtered or unexported fields
}

SFTP storage

type: sftp

type SSH

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

SSH

host: port: 22 username: password: timeout: 300 private_key: ~/.ssh/id_rsa passpharase:

type Storage

type Storage interface {
	// contains filtered or unexported methods
}

Storage interface

type WebDAV

type WebDAV struct {
	Base
	// contains filtered or unexported fields
}

WebDAV storage

# Install WebDAV Server on macOS https://github.com/hacdias/webdav/releases/tag/v4.2.0

 echo "users:\n  - username: admin\n    password: admin" > config.yml
	./webdav --port 8080 -c config.yml

type: webdav root: http://localhost:8080 username: password: path: backups

Jump to

Keyboard shortcuts

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