backupstore

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FSStorage = "fs"
	S3Storage = "s3"
)

Variables

This section is empty.

Functions

func GetProviderFactoryType

func GetProviderFactoryType() []string

func RegisterProvider

func RegisterProvider(factory ProviderFactory)

Types

type BackupStore

type BackupStore interface {
	Save(ctx context.Context, r io.Reader, fileName string) error
	Delete(ctx context.Context, fileName string) error
	Download(ctx context.Context, fileName string, w io.Writer) error
}

type DynamicOptions

type DynamicOptions map[string]interface{}

func (DynamicOptions) MarshalJSON

func (o DynamicOptions) MarshalJSON() ([]byte, error)

type FilesystemStore

type FilesystemStore struct {
	RootDir string `json:"rootDir,omitempty" yaml:"rootDir,omitempty"` // root directory for storing backup files
}

func (*FilesystemStore) Create

func (fs *FilesystemStore) Create() (BackupStore, error)

func (*FilesystemStore) Delete

func (fs *FilesystemStore) Delete(ctx context.Context, fileName string) (err error)

func (*FilesystemStore) Download

func (fs *FilesystemStore) Download(ctx context.Context, fileName string, w io.Writer) (err error)

func (*FilesystemStore) Save

func (fs *FilesystemStore) Save(ctx context.Context, r io.Reader, fileName string) (err error)

func (*FilesystemStore) Type

func (fs *FilesystemStore) Type() string

type ObjectStore

type ObjectStore struct {
	Bucket          string `json:"bucket" yaml:"bucket"`
	Endpoint        string `json:"endpoint" yaml:"endpoint"`
	AccessKeyID     string `json:"accessKeyID" yaml:"accessKeyID"`
	AccessKeySecret string `json:"accessKeySecret" yaml:"accessKeySecret"`
	Region          string `json:"region" yaml:"region"`
	SSL             bool   `json:"ssl" yaml:"ssl"`
	Client          *minio.Client
}

func (*ObjectStore) Create

func (receiver *ObjectStore) Create() (BackupStore, error)

func (*ObjectStore) Delete

func (receiver *ObjectStore) Delete(ctx context.Context, fileName string) (err error)

func (*ObjectStore) Download

func (receiver *ObjectStore) Download(ctx context.Context, fileName string, w io.Writer) (err error)

func (*ObjectStore) Save

func (receiver *ObjectStore) Save(ctx context.Context, r io.Reader, fileName string) (err error)

func (*ObjectStore) Type

func (receiver *ObjectStore) Type() string

type Options

type Options struct {
	Type     string         `json:"type" yaml:"type"`
	Provider DynamicOptions `json:"provider" yaml:"provider"`
}

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet)

func (*Options) Validate

func (o *Options) Validate() error

type ProviderFactory

type ProviderFactory interface {
	Type() string
	Create() (BackupStore, error)
}

type StoreType

type StoreType string

Jump to

Keyboard shortcuts

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