binlog

package
v1.0.4-hotfix Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustPosition added in v1.0.4

func AdjustPosition(pos gmysql.Position) gmysql.Position

AdjustPosition adjusts the filename with uuid suffix in mysql position for example: mysql-bin|000001.000002 -> mysql-bin.000002

func ComparePosition added in v1.0.4

func ComparePosition(pos1, pos2 gmysql.Position) int

ComparePosition returns:

1 if pos1 is bigger than pos2
0 if pos1 is equal to pos2
-1 if pos1 is less than pos2

func ConstructFilename

func ConstructFilename(baseName, seq string) string

ConstructFilename constructs a binlog filename from the basename and seq.

func ConstructFilenameWithUUIDSuffix

func ConstructFilenameWithUUIDSuffix(originalName Filename, uuidSuffix string) string

ConstructFilenameWithUUIDSuffix constructs a binlog filename with UUID suffix.

func ExtractPos

func ExtractPos(pos gmysql.Position, uuids []string) (uuidWithSuffix string, uuidSuffix string, realPos gmysql.Position, err error)

ExtractPos extracts (uuidWithSuffix, uuidSuffix, originalPos) from input pos (originalPos or convertedPos)

func GetFilenameIndex

func GetFilenameIndex(filename string) (int64, error)

GetFilenameIndex returns a int64 index value (seq number) of the filename.

func PositionFromStr

func PositionFromStr(s string) (gmysql.Position, error)

PositionFromStr constructs a mysql.Position from a string representation like `mysql-bin.000001:2345`

func RealMySQLPos

func RealMySQLPos(pos gmysql.Position) (gmysql.Position, error)

RealMySQLPos parses a relay position and returns a mysql position and whether error occurs if parsed successfully and `UUIDSuffix` exists, sets position Name to `originalPos.NamePrefix + binlogFilenameSep + originalPos.NameSuffix`. if parsed failed returns the given position and the traced error.

func VerifyFilename

func VerifyFilename(filename string) bool

VerifyFilename verifies whether is a valid MySQL/MariaDB binlog filename. valid format is `base + '.' + seq`.

Types

type Filename

type Filename struct {
	BaseName string
	Seq      string
	SeqInt64 int64
}

Filename represents a binlog filename.

func ParseFilename

func ParseFilename(filename string) (Filename, error)

ParseFilename parses a string representation binlog filename into a `Filename`.

func (Filename) GreaterThan

func (f Filename) GreaterThan(other Filename) bool

GreaterThan checks whether this filename > other filename.

func (Filename) GreaterThanOrEqualTo

func (f Filename) GreaterThanOrEqualTo(other Filename) bool

GreaterThanOrEqualTo checks whether this filename >= other filename.

func (Filename) LessThan

func (f Filename) LessThan(other Filename) bool

LessThan checks whether this filename < other filename.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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