Documentation ¶
Index ¶
- Variables
- func DownloadFile(s Storager, ctx context.Context, ppath string, dest string) error
- func FileChan() chan *PutFile
- func HasForm(engineName string, formName string) bool
- func LevelDB() *dbPool
- func MonitorBackupStop(id uint) error
- func NewLevelDBPool() *dbPool
- func ParseDBValue(val []byte) (md5 string, startTs, endTs, fileModifyTs, fileSize int64)
- func RecordLog(ctx echo.Context, err error, cfg *dbschema.NgingCloudBackup, filePath string, ...)
- func Register(name string, constructor Constructor, forms []Form, label string)
- func ResetFileChan()
- func Restore(ctx echo.Context, cfg dbschema.NgingCloudBackup, ...) error
- func RetryablePut(ctx context.Context, mgr Storager, fp io.ReadSeekCloser, objectName string, ...) error
- type Cloudbackup
- type Constructor
- type ErrIsAccessDenied
- type Form
- type ProgressorSetter
- type PutFile
- type StorageFTP
- func (s *StorageFTP) Close() (err error)
- func (s *StorageFTP) Connect() (err error)
- func (s *StorageFTP) Download(ctx context.Context, ppath string, w io.Writer) error
- func (s *StorageFTP) MkdirAll(dir string) (err error)
- func (s *StorageFTP) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error)
- func (s *StorageFTP) Remove(ctx context.Context, ppath string) error
- func (s *StorageFTP) RemoveDir(ctx context.Context, ppath string) error
- func (s *StorageFTP) Restore(ctx context.Context, ppath string, destpath string, ...) error
- func (s *StorageFTP) SetProgressor(prog notice.Progressor)
- type StorageMock
- func (s *StorageMock) Close() (err error)
- func (s *StorageMock) Connect() (err error)
- func (s *StorageMock) Download(ctx context.Context, ppath string, w io.Writer) error
- func (s *StorageMock) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error)
- func (s *StorageMock) Remove(ctx context.Context, ppath string) error
- func (s *StorageMock) RemoveDir(ctx context.Context, ppath string) error
- func (s *StorageMock) Restore(ctx context.Context, ppath string, destpath string, ...) error
- type StorageS3
- func (s *StorageS3) Close() (err error)
- func (s *StorageS3) Connect() (err error)
- func (s *StorageS3) Download(ctx context.Context, ppath string, w io.Writer) error
- func (s *StorageS3) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error)
- func (s *StorageS3) Remove(ctx context.Context, ppath string) error
- func (s *StorageS3) RemoveDir(ctx context.Context, ppath string) error
- func (s *StorageS3) Restore(ctx context.Context, ppath string, destpath string, ...) error
- func (s *StorageS3) SetProgressor(prog notice.Progressor)
- type StorageSMB
- func (s *StorageSMB) Close() (err error)
- func (s *StorageSMB) Connect() (err error)
- func (s *StorageSMB) Download(ctx context.Context, ppath string, w io.Writer) error
- func (s *StorageSMB) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error)
- func (s *StorageSMB) Remove(ctx context.Context, ppath string) error
- func (s *StorageSMB) RemoveDir(ctx context.Context, ppath string) error
- func (s *StorageSMB) Restore(ctx context.Context, ppath string, destpath string, ...) error
- func (s *StorageSMB) SetProgressor(prog notice.Progressor)
- type StorageWebDAV
- func (s *StorageWebDAV) Close() (err error)
- func (s *StorageWebDAV) Connect() (err error)
- func (s *StorageWebDAV) Download(ctx context.Context, ppath string, w io.Writer) error
- func (s *StorageWebDAV) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error)
- func (s *StorageWebDAV) Remove(ctx context.Context, ppath string) error
- func (s *StorageWebDAV) RemoveDir(ctx context.Context, ppath string) error
- func (s *StorageWebDAV) Restore(ctx context.Context, ppath string, destpath string, ...) error
- func (s *StorageWebDAV) SetProgressor(prog notice.Progressor)
- type Storager
- func NewStorage(ctx echo.Context, cfg dbschema.NgingCloudBackup) (Storager, error)
- func NewStorageFTP(addr, username, password string) Storager
- func NewStorageMock() Storager
- func NewStorageS3(cfg dbschema.NgingCloudStorage) Storager
- func NewStorageSMB(addr, username, password, sharename string) Storager
- func NewStorageWebDAV(uri, username, password string) Storager
- type Task
Constants ¶
This section is empty.
Variables ¶
View Source
var (
BackupTasks = param.NewMap()
)
View Source
var ErrEmptyConfig = errors.New(`empty config`)
View Source
var ErrUnsupported = errors.New(`unsupported storage engine`)
View Source
var Forms = map[string][]Form{}
View Source
var (
LevelDBDir = `data/cache/backup-db`
)
Functions ¶
func DownloadFile ¶
func MonitorBackupStop ¶
func NewLevelDBPool ¶
func NewLevelDBPool() *dbPool
func ParseDBValue ¶
func ResetFileChan ¶
func ResetFileChan()
func Restore ¶
func Restore(ctx echo.Context, cfg dbschema.NgingCloudBackup, callback func(from, to string), prog notice.Progressor) error
func RetryablePut ¶
Types ¶
type Cloudbackup ¶
type Cloudbackup struct { SourcePath string DestPath string Filter func(string) bool WaitFillCompleted bool IgnoreWaitRegexp *regexp.Regexp // contains filtered or unexported fields }
func New ¶
func New(mgr Storager, cfg dbschema.NgingCloudBackup) *Cloudbackup
func (*Cloudbackup) OnCreate ¶
func (c *Cloudbackup) OnCreate(file string)
func (*Cloudbackup) OnDelete ¶
func (c *Cloudbackup) OnDelete(file string)
func (*Cloudbackup) OnModify ¶
func (c *Cloudbackup) OnModify(file string)
func (*Cloudbackup) OnRename ¶
func (c *Cloudbackup) OnRename(file string)
type Constructor ¶
type ErrIsAccessDenied ¶
type ProgressorSetter ¶
type ProgressorSetter interface {
SetProgressor(notice.Progressor)
}
type PutFile ¶
type StorageFTP ¶
type StorageFTP struct {
// contains filtered or unexported fields
}
func (*StorageFTP) Close ¶
func (s *StorageFTP) Close() (err error)
func (*StorageFTP) Connect ¶
func (s *StorageFTP) Connect() (err error)
func (*StorageFTP) MkdirAll ¶
func (s *StorageFTP) MkdirAll(dir string) (err error)
func (*StorageFTP) RemoveDir ¶
func (s *StorageFTP) RemoveDir(ctx context.Context, ppath string) error
func (*StorageFTP) SetProgressor ¶
func (s *StorageFTP) SetProgressor(prog notice.Progressor)
type StorageMock ¶
type StorageMock struct { }
func (*StorageMock) Close ¶
func (s *StorageMock) Close() (err error)
func (*StorageMock) Connect ¶
func (s *StorageMock) Connect() (err error)
type StorageS3 ¶
type StorageS3 struct {
// contains filtered or unexported fields
}
func (*StorageS3) SetProgressor ¶
func (s *StorageS3) SetProgressor(prog notice.Progressor)
type StorageSMB ¶
type StorageSMB struct {
// contains filtered or unexported fields
}
func (*StorageSMB) Close ¶
func (s *StorageSMB) Close() (err error)
func (*StorageSMB) Connect ¶
func (s *StorageSMB) Connect() (err error)
func (*StorageSMB) RemoveDir ¶
func (s *StorageSMB) RemoveDir(ctx context.Context, ppath string) error
func (*StorageSMB) SetProgressor ¶
func (s *StorageSMB) SetProgressor(prog notice.Progressor)
type StorageWebDAV ¶
type StorageWebDAV struct {
// contains filtered or unexported fields
}
func (*StorageWebDAV) Close ¶
func (s *StorageWebDAV) Close() (err error)
func (*StorageWebDAV) Connect ¶
func (s *StorageWebDAV) Connect() (err error)
func (*StorageWebDAV) Remove ¶
func (s *StorageWebDAV) Remove(ctx context.Context, ppath string) error
func (*StorageWebDAV) RemoveDir ¶
func (s *StorageWebDAV) RemoveDir(ctx context.Context, ppath string) error
func (*StorageWebDAV) SetProgressor ¶
func (s *StorageWebDAV) SetProgressor(prog notice.Progressor)
type Storager ¶
type Storager interface { Connect() (err error) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error) Download(ctx context.Context, ppath string, w io.Writer) error RemoveDir(ctx context.Context, ppath string) error Remove(ctx context.Context, ppath string) error Restore(ctx context.Context, ppath string, destpath string, callback func(from, to string)) error Close() (err error) }
func NewStorage ¶
func NewStorageFTP ¶
func NewStorageMock ¶
func NewStorageMock() Storager
func NewStorageS3 ¶
func NewStorageS3(cfg dbschema.NgingCloudStorage) Storager
func NewStorageSMB ¶
func NewStorageWebDAV ¶
Click to show internal directories.
Click to hide internal directories.