binlog

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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