Documentation ¶
Index ¶
- Constants
- func BinlogNum(filename string) int
- func BinlogPrefix(filename string) string
- func FetchBinlogSentinel(folder storage.Folder, sentinelDto interface{}) error
- func GetBinlogPreviousGTIDs(filename string, flavor string) (mysql.GTIDSet, error)
- func GetBinlogPreviousGTIDsRemote(folder storage.Folder, filename string, flavor string) (mysql.GTIDSet, error)
- func GetBinlogStartTimestamp(filename string, flavor string) (time.Time, error)
- func GetBinlogTS(folder storage.Folder, binlogName string) (time.Time, error)
- func HandleBackupFetch(folder storage.Folder, targetBackupSelector internal.BackupSelector, ...)
- func HandleBackupPush(folder storage.Folder, uploader internal.Uploader, backupCmd *exec.Cmd, ...)
- func HandleBinlogFetch(folder storage.Folder, backupName string, untilTS string, ...)
- func HandleBinlogFind(folder storage.Folder, gtid string)
- func HandleBinlogPush(uploader internal.Uploader, untilBinlog string, checkGTIDs bool)
- func HandleBinlogReplay(folder storage.Folder, backupName string, untilTS string, ...)
- func HandleBinlogServer(since string, until, sinceTS string)
- func HandleCopyAll(fromConfigFile string, toConfigFile string)
- func HandleCopyBackup(fromConfigFile, toConfigFile, backupName, prefix string)
- func HandleDetailedBackupList(folder storage.Folder, pretty, json bool)
- func MarkBackup(uploader internal.Uploader, backupName string, toPermanent bool)
- func UploadBinlogSentinel(folder storage.Folder, sentinelDto interface{}) error
- func WildcardInfo(from storage.Folder, to storage.Folder) ([]copy.InfoProvider, error)
- type BackupDetail
- type BinlogSentinelDto
- type GenericMetaFetcher
- type GenericMetaInteractor
- type GenericMetaSetter
- type Handler
- func (h Handler) HandleBinlogDump(pos mysql.Position) (*replication.BinlogStreamer, error)
- func (h Handler) HandleBinlogDumpGTID(gtidSet *mysql.MysqlGTIDSet) (*replication.BinlogStreamer, error)
- func (h Handler) HandleQuery(query string) (*mysql.Result, error)
- func (h Handler) HandleRegisterSlave(data []byte) error
- type LogsCache
- type StreamSentinelDto
Constants ¶
View Source
const BinlogCacheFileName = ".walg_mysql_binlogs_cache"
View Source
const BinlogPath = "binlog_" + utility.VersionStr + "/"
View Source
const BinlogReadHeaderSize = 128 * 1024
128k should be enough to parse prev_gtids event
View Source
const BinlogSentinelPath = "binlog_sentinel_" + utility.VersionStr + ".json"
View Source
const TimeMysqlFormat = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func BinlogNum ¶
Mysql binlog file names looks like foobar.000001, foobar.000002 (with leading zeroes) And it looks like they can be compared lexicographically, but.. The next name after foobar.999999 is foobar.1000000 (7 digits) and it cannot be compared so.
func BinlogPrefix ¶
func FetchBinlogSentinel ¶
func GetBinlogPreviousGTIDs ¶
func GetBinlogStartTimestamp ¶
func HandleBackupFetch ¶
func HandleBackupPush ¶
func HandleBinlogFetch ¶
func HandleBinlogFind ¶
func HandleBinlogPush ¶
func HandleBinlogReplay ¶
func HandleBinlogServer ¶
func HandleCopyAll ¶
HandleCopyBackup copy all backups from one storage to another
func HandleCopyBackup ¶
func HandleCopyBackup(fromConfigFile, toConfigFile, backupName, prefix string)
HandleCopyBackup copy specific backups from one storage to another
func MarkBackup ¶
MarkBackup marks a backup as permanent or impermanent
func UploadBinlogSentinel ¶
func WildcardInfo ¶
Types ¶
type BackupDetail ¶
type BackupDetail struct { BackupName string `json:"backup_name"` ModifyTime time.Time `json:"modify_time"` BinLogStart string `json:"binlog_start"` BinLogEnd string `json:"binlog_end"` StartLocalTime time.Time `json:"start_local_time"` StopLocalTime time.Time `json:"stop_local_time"` // these fields were introduced recently in // https://github.com/apecloud/dataprotection-wal-g/pull/930 // so it is not guaranteed that sentinel contains them UncompressedSize int64 `json:"uncompressed_size,omitempty"` CompressedSize int64 `json:"compressed_size,omitempty"` Hostname string `json:"hostname,omitempty"` IsPermanent bool `json:"is_permanent"` UserData interface{} `json:"user_data,omitempty"` }
func NewBackupDetail ¶
func NewBackupDetail(backupTime internal.BackupTime, sentinel StreamSentinelDto) BackupDetail
type BinlogSentinelDto ¶
type BinlogSentinelDto struct {
GTIDArchived string `json:"GtidArchived"`
}
func (*BinlogSentinelDto) String ¶
func (dto *BinlogSentinelDto) String() string
type GenericMetaFetcher ¶
type GenericMetaFetcher struct{}
func NewGenericMetaFetcher ¶
func NewGenericMetaFetcher() GenericMetaFetcher
func (GenericMetaFetcher) Fetch ¶
func (mf GenericMetaFetcher) Fetch(backupName string, backupFolder storage.Folder) (internal.GenericMetadata, error)
TODO: Unit tests
type GenericMetaInteractor ¶
type GenericMetaInteractor struct { GenericMetaFetcher GenericMetaSetter }
func NewGenericMetaInteractor ¶
func NewGenericMetaInteractor() GenericMetaInteractor
type GenericMetaSetter ¶
type GenericMetaSetter struct{}
func NewGenericMetaSetter ¶
func NewGenericMetaSetter() GenericMetaSetter
func (GenericMetaSetter) SetIsPermanent ¶
func (ms GenericMetaSetter) SetIsPermanent(backupName string, backupFolder storage.Folder, isPermanent bool) error
TODO: Unit tests
func (GenericMetaSetter) SetUserData ¶
func (ms GenericMetaSetter) SetUserData(backupName string, backupFolder storage.Folder, userData interface{}) error
TODO: Unit tests
type Handler ¶
type Handler struct {
server.EmptyReplicationHandler
}
func (Handler) HandleBinlogDump ¶
func (h Handler) HandleBinlogDump(pos mysql.Position) (*replication.BinlogStreamer, error)
func (Handler) HandleBinlogDumpGTID ¶
func (h Handler) HandleBinlogDumpGTID(gtidSet *mysql.MysqlGTIDSet) (*replication.BinlogStreamer, error)
func (Handler) HandleRegisterSlave ¶
type StreamSentinelDto ¶
type StreamSentinelDto struct { BinLogStart string `json:"BinLogStart,omitempty"` // BinLogEnd field is for debug purpose only. // As we can not guarantee that transactions in BinLogEnd file happened before or after backup BinLogEnd string `json:"BinLogEnd,omitempty"` StartLocalTime time.Time `json:"StartLocalTime,omitempty"` StopLocalTime time.Time `json:"StopLocalTime,omitempty"` UncompressedSize int64 `json:"UncompressedSize,omitempty"` CompressedSize int64 `json:"CompressedSize,omitempty"` Hostname string `json:"Hostname,omitempty"` IsPermanent bool `json:"IsPermanent,omitempty"` UserData interface{} `json:"UserData,omitempty"` }
func (*StreamSentinelDto) String ¶
func (s *StreamSentinelDto) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.