mysql

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const BinlogCacheFileName = ".walg_mysql_binlogs_cache"
View Source
const BinlogEventHeaderSize = 13
View Source
const BinlogMagicLength = 4
View Source
const BinlogPath = "binlog_" + utility.VersionStr + "/"
View Source
const TimeMysqlFormat = "2006-01-02 15:04:05"

Variables

View Source
var BinlogMagic = [...]byte{0xfe, 0x62, 0x69, 0x6e}

Functions

func GetBinlogStartTimestamp added in v0.2.23

func GetBinlogStartTimestamp(path string) (time.Time, error)

func HandleBackupFetch added in v0.2.23

func HandleBackupFetch(folder storage.Folder,
	targetBackupSelector internal.BackupSelector,
	restoreCmd *exec.Cmd,
	prepareCmd *exec.Cmd)

func HandleBackupPush added in v0.2.14

func HandleBackupPush(uploader *internal.Uploader, backupCmd *exec.Cmd, isPermanent bool)

func HandleBinlogFetch added in v0.2.14

func HandleBinlogFetch(folder storage.Folder, backupName string, untilTS string)

func HandleBinlogPush

func HandleBinlogPush(uploader *internal.Uploader)

func HandleBinlogReplay added in v0.2.23

func HandleBinlogReplay(folder storage.Folder, backupName string, untilTS string)

func HandleCopyAll added in v0.2.23

func HandleCopyAll(fromConfigFile string, toConfigFile string)

HandleCopyBackup copy all backups from one storage to another

func HandleCopyBackup added in v0.2.23

func HandleCopyBackup(fromConfigFile, toConfigFile, backupName, prefix string)

HandleCopyBackup copy specific backups from one storage to another

func HandleDetailedBackupList added in v0.2.23

func HandleDetailedBackupList(folder storage.Folder, pretty, json bool)

func MarkBackup added in v0.2.23

func MarkBackup(uploader *internal.Uploader, backupName string, toPermanent bool)

MarkBackup marks a backup as permanent or impermanent

func WildcardInfo added in v0.2.23

func WildcardInfo(from storage.Folder, to storage.Folder) ([]copy.InfoProvider, error)

Types

type BackupDetail added in v0.2.23

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/wal-g/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 added in v0.2.23

func NewBackupDetail(backupTime internal.BackupTime, sentinel StreamSentinelDto) BackupDetail

type BinlogEventHeader added in v0.2.23

type BinlogEventHeader struct {
	Timestamp   uint32
	TypeCode    uint8
	ServerID    uint32
	EventLength uint32
}

https://dev.mysql.com/doc/internals/en/event-structure.html First 4 fields are the same in all versions

func ParseEventHeader added in v0.2.23

func ParseEventHeader(buf []byte) (header BinlogEventHeader)

type BinlogReader added in v0.2.23

type BinlogReader struct {
	// contains filtered or unexported fields
}

func NewBinlogReader added in v0.2.23

func NewBinlogReader(reader io.Reader, startTS time.Time, endTS time.Time) *BinlogReader

func (*BinlogReader) NeedAbort added in v0.2.23

func (bl *BinlogReader) NeedAbort() bool

func (*BinlogReader) Read added in v0.2.23

func (bl *BinlogReader) Read(buf []byte) (int, error)

type GenericMetaFetcher added in v0.2.23

type GenericMetaFetcher struct{}

func NewGenericMetaFetcher added in v0.2.23

func NewGenericMetaFetcher() GenericMetaFetcher

func (GenericMetaFetcher) Fetch added in v0.2.23

func (mf GenericMetaFetcher) Fetch(backupName string, backupFolder storage.Folder) (internal.GenericMetadata, error)

type GenericMetaInteractor added in v0.2.23

type GenericMetaInteractor struct {
	GenericMetaFetcher
	GenericMetaSetter
}

func NewGenericMetaInteractor added in v0.2.23

func NewGenericMetaInteractor() GenericMetaInteractor

type GenericMetaSetter added in v0.2.23

type GenericMetaSetter struct{}

func NewGenericMetaSetter added in v0.2.23

func NewGenericMetaSetter() GenericMetaSetter

func (GenericMetaSetter) SetIsPermanent added in v0.2.23

func (ms GenericMetaSetter) SetIsPermanent(backupName string, backupFolder storage.Folder, isPermanent bool) error

func (GenericMetaSetter) SetUserData added in v0.2.23

func (ms GenericMetaSetter) SetUserData(backupName string, backupFolder storage.Folder, userData interface{}) error

type LogsCache added in v0.2.12

type LogsCache struct {
	LastArchivedBinlog string `json:"LastArchivedBinlog"`
}

type StreamSentinelDto

type StreamSentinelDto struct {
	BinLogStart    string    `json:"BinLogStart,omitempty"`
	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 added in v0.2.23

func (s *StreamSentinelDto) String() string

Jump to

Keyboard shortcuts

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