Documentation ¶
Index ¶
- func AdjustPosition(pos gmysql.Position) gmysql.Position
- func ComparePosition(pos1, pos2 gmysql.Position) int
- func ConstructFilename(baseName, seq string) string
- func ConstructFilenameWithUUIDSuffix(originalName Filename, uuidSuffix string) string
- func ExtractPos(pos gmysql.Position, uuids []string) (uuidWithSuffix string, uuidSuffix string, realPos gmysql.Position, err error)
- func GetFilenameIndex(filename string) (int64, error)
- func PositionFromStr(s string) (gmysql.Position, error)
- func RealMySQLPos(pos gmysql.Position) (gmysql.Position, error)
- func VerifyFilename(filename string) bool
- type Filename
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustPosition ¶ added in v1.0.4
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
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 ¶
ConstructFilename constructs a binlog filename from the basename and seq.
func ConstructFilenameWithUUIDSuffix ¶
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 ¶
GetFilenameIndex returns a int64 index value (seq number) of the filename.
func PositionFromStr ¶
PositionFromStr constructs a mysql.Position from a string representation like `mysql-bin.000001:2345`
func RealMySQLPos ¶
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 ¶
VerifyFilename verifies whether is a valid MySQL/MariaDB binlog filename. valid format is `base + '.' + seq`.
Types ¶
type Filename ¶
Filename represents a binlog filename.
func ParseFilename ¶
ParseFilename parses a string representation binlog filename into a `Filename`.
func (Filename) GreaterThan ¶
GreaterThan checks whether this filename > other filename.
func (Filename) GreaterThanOrEqualTo ¶
GreaterThanOrEqualTo checks whether this filename >= other filename.