Documentation
¶
Index ¶
- type BackupStorage
- type LocalBackupStorage
- func (s *LocalBackupStorage) GetFileStream(key string) (io.Reader, error)
- func (s *LocalBackupStorage) GetKPastBackupKey(db string, k int) (string, error)
- func (s *LocalBackupStorage) GetLatestToLSN(db string) (string, error)
- func (s *LocalBackupStorage) GetStorageType() string
- func (s *LocalBackupStorage) PostFile(key string, name string, r io.Reader) error
- func (s *LocalBackupStorage) RemoveBackups(cli *clientv3.Client, key string) error
- func (s *LocalBackupStorage) RestoreBackupInfo(cli *clientv3.Client) error
- func (s *LocalBackupStorage) SearchConsecutiveIncBackups(db string, from time.Time) ([]*storagepb.BackupFileInfo, error)
- func (s *LocalBackupStorage) SearchStaringPointByLSN(db, lsn string) (string, error)
- func (s *LocalBackupStorage) TransferTempFullBackup(tempDir string, key string) error
- func (s *LocalBackupStorage) TransferTempIncBackup(tempDir string, key string) error
- type LocalStorageConfig
- type MockBackupStorage
- func (_m *MockBackupStorage) EXPECT() *_MockBackupStorageRecorder
- func (_m *MockBackupStorage) GetFileStream(key string) (io.Reader, error)
- func (_m *MockBackupStorage) GetKPastBackupKey(db string, k int) (string, error)
- func (_m *MockBackupStorage) GetLatestToLSN(db string) (string, error)
- func (_m *MockBackupStorage) GetStorageType() string
- func (_m *MockBackupStorage) PostFile(key string, name string, r io.Reader) error
- func (_m *MockBackupStorage) RemoveBackups(cli *clientv3.Client, key string) error
- func (_m *MockBackupStorage) RestoreBackupInfo(cli *clientv3.Client) error
- func (_m *MockBackupStorage) SearchConsecutiveIncBackups(db string, from time.Time) ([]*storagepb.BackupFileInfo, error)
- func (_m *MockBackupStorage) SearchStaringPointByLSN(db string, lsn string) (string, error)
- func (_m *MockBackupStorage) TransferTempFullBackup(tempDir string, key string) error
- func (_m *MockBackupStorage) TransferTempIncBackup(tempDir string, key string) error
- type StorageService
- func (s *StorageService) GetBestStartTime(ctx context.Context, req *storagepb.GetBestStartTimeRequest) (*storagepb.GetBestStartTimeResponse, error)
- func (s *StorageService) GetFileByKey(req *storagepb.GetFileByKeyRequest, ...) error
- func (s *StorageService) GetKeysAtPoint(ctx context.Context, req *storagepb.GetKeysAtPointRequest) (*storagepb.GetKeysAtPointResponse, error)
- func (s *StorageService) GetLatestToLSN(ctx context.Context, req *storagepb.GetLatestToLSNRequest) (*storagepb.GetLatestToLSNResponse, error)
- func (s *StorageService) PurgePrevBackup(ctx context.Context, req *storagepb.PurgePrevBackupRequest) (*storagepb.PurgePrevBackupResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupStorage ¶
type BackupStorage interface {
GetStorageType() string
GetLatestToLSN(db string) (string, error)
SearchStaringPointByLSN(db, lsn string) (string, error)
TransferTempFullBackup(tempDir string, key string) error
TransferTempIncBackup(tempDir string, key string) error
SearchConsecutiveIncBackups(db string, from time.Time) ([]*storagepb.BackupFileInfo, error)
GetFileStream(key string) (io.Reader, error)
PostFile(key string, name string, r io.Reader) error
RemoveBackups(cli *clientv3.Client, key string) error
GetKPastBackupKey(db string, k int) (string, error)
RestoreBackupInfo(cli *clientv3.Client) error
}
type LocalBackupStorage ¶
LocalBackupStorage represents local directory backup.
func NewLocalBackupStorage ¶
func NewLocalBackupStorage(cfg *LocalStorageConfig) (*LocalBackupStorage, error)
NewLocalBackupStorage returns LocalBackupStorage based on the configuration.
func (*LocalBackupStorage) GetFileStream ¶
func (s *LocalBackupStorage) GetFileStream(key string) (io.Reader, error)
func (*LocalBackupStorage) GetKPastBackupKey ¶
func (s *LocalBackupStorage) GetKPastBackupKey(db string, k int) (string, error)
func (*LocalBackupStorage) GetLatestToLSN ¶
func (s *LocalBackupStorage) GetLatestToLSN(db string) (string, error)
GetLatestToLSN fetches `to_lsn` from most recent backup.
func (*LocalBackupStorage) GetStorageType ¶
func (s *LocalBackupStorage) GetStorageType() string
GetStorageType returns storage type
func (*LocalBackupStorage) RemoveBackups ¶
func (s *LocalBackupStorage) RemoveBackups(cli *clientv3.Client, key string) error
func (*LocalBackupStorage) RestoreBackupInfo ¶
func (s *LocalBackupStorage) RestoreBackupInfo(cli *clientv3.Client) error
func (*LocalBackupStorage) SearchConsecutiveIncBackups ¶
func (s *LocalBackupStorage) SearchConsecutiveIncBackups( db string, from time.Time, ) ([]*storagepb.BackupFileInfo, error)
func (*LocalBackupStorage) SearchStaringPointByLSN ¶
func (s *LocalBackupStorage) SearchStaringPointByLSN(db, lsn string) (string, error)
SearchStartingPointByLSN returns a starting point containing `to_lsn` equals lsn.
func (*LocalBackupStorage) TransferTempFullBackup ¶
func (s *LocalBackupStorage) TransferTempFullBackup(tempDir string, key string) error
func (*LocalBackupStorage) TransferTempIncBackup ¶
func (s *LocalBackupStorage) TransferTempIncBackup(tempDir string, key string) error
type LocalStorageConfig ¶
type MockBackupStorage ¶
type MockBackupStorage struct {
// contains filtered or unexported fields
}
Mock of BackupStorage interface
func NewMockBackupStorage ¶
func NewMockBackupStorage(ctrl *gomock.Controller) *MockBackupStorage
func (*MockBackupStorage) EXPECT ¶
func (_m *MockBackupStorage) EXPECT() *_MockBackupStorageRecorder
func (*MockBackupStorage) GetFileStream ¶
func (_m *MockBackupStorage) GetFileStream(key string) (io.Reader, error)
func (*MockBackupStorage) GetKPastBackupKey ¶
func (_m *MockBackupStorage) GetKPastBackupKey(db string, k int) (string, error)
func (*MockBackupStorage) GetLatestToLSN ¶
func (_m *MockBackupStorage) GetLatestToLSN(db string) (string, error)
func (*MockBackupStorage) GetStorageType ¶
func (_m *MockBackupStorage) GetStorageType() string
func (*MockBackupStorage) RemoveBackups ¶
func (_m *MockBackupStorage) RemoveBackups(cli *clientv3.Client, key string) error
func (*MockBackupStorage) RestoreBackupInfo ¶
func (_m *MockBackupStorage) RestoreBackupInfo(cli *clientv3.Client) error
func (*MockBackupStorage) SearchConsecutiveIncBackups ¶
func (_m *MockBackupStorage) SearchConsecutiveIncBackups(db string, from time.Time) ([]*storagepb.BackupFileInfo, error)
func (*MockBackupStorage) SearchStaringPointByLSN ¶
func (_m *MockBackupStorage) SearchStaringPointByLSN(db string, lsn string) (string, error)
func (*MockBackupStorage) TransferTempFullBackup ¶
func (_m *MockBackupStorage) TransferTempFullBackup(tempDir string, key string) error
func (*MockBackupStorage) TransferTempIncBackup ¶
func (_m *MockBackupStorage) TransferTempIncBackup(tempDir string, key string) error
type StorageService ¶
func NewStorageService ¶
func NewStorageService( storage BackupStorage, rateLimit uint64, aggregator *status.WeeklyBackupAggregator, ) *StorageService
func (*StorageService) GetBestStartTime ¶
func (s *StorageService) GetBestStartTime( ctx context.Context, req *storagepb.GetBestStartTimeRequest, ) (*storagepb.GetBestStartTimeResponse, error)
func (*StorageService) GetFileByKey ¶
func (s *StorageService) GetFileByKey( req *storagepb.GetFileByKeyRequest, stream storagepb.StorageService_GetFileByKeyServer, ) error
func (*StorageService) GetKeysAtPoint ¶
func (s *StorageService) GetKeysAtPoint( ctx context.Context, req *storagepb.GetKeysAtPointRequest, ) (*storagepb.GetKeysAtPointResponse, error)
func (*StorageService) GetLatestToLSN ¶
func (s *StorageService) GetLatestToLSN( ctx context.Context, req *storagepb.GetLatestToLSNRequest, ) (*storagepb.GetLatestToLSNResponse, error)
func (*StorageService) PurgePrevBackup ¶
func (s *StorageService) PurgePrevBackup( ctx context.Context, req *storagepb.PurgePrevBackupRequest, ) (*storagepb.PurgePrevBackupResponse, error)
Click to show internal directories.
Click to hide internal directories.