mirror of
https://gitee.com/dromara/mayfly-go
synced 2026-01-03 13:16:35 +08:00
feat: flow design & page query refactor
This commit is contained in:
@@ -2,8 +2,6 @@ package dbi
|
||||
|
||||
import (
|
||||
"context"
|
||||
"mayfly-go/internal/db/domain/entity"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -11,9 +9,9 @@ type DbProgram interface {
|
||||
CheckBinlogEnabled(ctx context.Context) (bool, error)
|
||||
CheckBinlogRowFormat(ctx context.Context) (bool, error)
|
||||
|
||||
Backup(ctx context.Context, backupHistory *entity.DbBackupHistory) (*entity.BinlogInfo, error)
|
||||
// Backup(ctx context.Context, backupHistory *entity.DbBackupHistory) (*entity.BinlogInfo, error)
|
||||
|
||||
FetchBinlogs(ctx context.Context, downloadLatestBinlogFile bool, earliestBackupSequence int64, latestBinlogHistory *entity.DbBinlogHistory) ([]*entity.BinlogFile, error)
|
||||
// FetchBinlogs(ctx context.Context, downloadLatestBinlogFile bool, earliestBackupSequence int64, latestBinlogHistory *entity.DbBinlogHistory) ([]*entity.BinlogFile, error)
|
||||
|
||||
ReplayBinlog(ctx context.Context, originalDatabase, targetDatabase string, restoreInfo *RestoreInfo) error
|
||||
|
||||
@@ -23,21 +21,22 @@ type DbProgram interface {
|
||||
|
||||
GetBinlogEventPositionAtOrAfterTime(ctx context.Context, binlogName string, targetTime time.Time) (position int64, parseErr error)
|
||||
|
||||
PruneBinlog(history *entity.DbBinlogHistory) error
|
||||
// PruneBinlog(history *entity.DbBinlogHistory) error
|
||||
}
|
||||
|
||||
type RestoreInfo struct {
|
||||
BackupHistory *entity.DbBackupHistory
|
||||
BinlogHistories []*entity.DbBinlogHistory
|
||||
StartPosition int64
|
||||
TargetPosition int64
|
||||
TargetTime time.Time
|
||||
// BackupHistory *entity.DbBackupHistory
|
||||
// BinlogHistories []*entity.DbBinlogHistory
|
||||
StartPosition int64
|
||||
TargetPosition int64
|
||||
TargetTime time.Time
|
||||
}
|
||||
|
||||
func (ri *RestoreInfo) GetBinlogPaths(binlogDir string) []string {
|
||||
files := make([]string, 0, len(ri.BinlogHistories))
|
||||
for _, history := range ri.BinlogHistories {
|
||||
files = append(files, filepath.Join(binlogDir, history.FileName))
|
||||
}
|
||||
return files
|
||||
// files := make([]string, 0, len(ri.BinlogHistories))
|
||||
// for _, history := range ri.BinlogHistories {
|
||||
// files = append(files, filepath.Join(binlogDir, history.FileName))
|
||||
// }
|
||||
// return files
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user