event

package
v0.0.0-...-744e9a0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package event binlog event parse library functions

Index

Constants

View Source
const (
	FileHeaderLength  = 4  // binlog file magic header 0XFE bin
	EventHeaderLength = 19 // event header length
)
View Source
const EncryptFileHeaderOffset = 512

EncryptFileHeaderOffset encrypt file header size

View Source
const KeyRingXORStr = `*305=Ljt0*!@$Hnm(*-9-w;:`

KeyRingXORStr mysql-server: plugin/keyring/common/keyring_key.cc obfuscate_str

Variables

View Source
var Ending bool
View Source
var FollowGTID bool
View Source
var FollowThreadID bool
View Source
var Starting bool

Functions

func BinlogFileParser

func BinlogFileParser(files []string) error

BinlogFileParser parser binary log file

func BinlogFilter

func BinlogFilter(event *replication.BinlogEvent) bool

BinlogFilter check if event will do

func BinlogParser

func BinlogParser()

BinlogParser ...

func BinlogStreamParser

func BinlogStreamParser() error

BinlogStreamParser parser mysql connection replication event

func CheckBinlogFileEncrypt

func CheckBinlogFileEncrypt(buf []byte) bool

CheckBinlogFileEncrypt check file is encrypted

func CheckBinlogFileHeader

func CheckBinlogFileHeader(buf []byte) bool

CheckBinlogFileHeader check file is binary log

func CheckBinlogFileTime

func CheckBinlogFileTime(files []string) error

CheckBinlogFileTime ...

func CheckBinlogFormat

func CheckBinlogFormat(dsn string) string

CheckBinlogFormat check binlog format

func DecryptBinlog

func DecryptBinlog(orgBinlog, keyring string) error

DecryptBinlog decrypt binlog file with keyring

func FileNextEvent

func FileNextEvent(p *replication.BinlogParser, r io.Reader, stream cipher.Stream) (*replication.BinlogEvent, error)

FileNextEvent ...

func FilterExcludeGTIDs

func FilterExcludeGTIDs(event *replication.BinlogEvent) bool

FilterExcludeGTIDs ...

func FilterIgnoreTables

func FilterIgnoreTables(event *replication.BinlogEvent) bool

FilterIgnoreTables ...

func FilterIncludeGTIDs

func FilterIncludeGTIDs(event *replication.BinlogEvent) bool

FilterIncludeGTIDs ...

func FilterQueryType

func FilterQueryType(event *replication.BinlogEvent) bool

FilterQueryType ...

func FilterServerID

func FilterServerID(event *replication.BinlogEvent) bool

FilterServerID ...

func FilterStartDatetime

func FilterStartDatetime(event *replication.BinlogEvent) bool

FilterStartDatetime ...

func FilterStartPos

func FilterStartPos(event *replication.BinlogEvent) bool

FilterStartPos ...

func FilterStopDatetime

func FilterStopDatetime(event *replication.BinlogEvent) bool

FilterStopDatetime ...

func FilterStopPos

func FilterStopPos(event *replication.BinlogEvent) bool

FilterStopPos ...

func FilterTables

func FilterTables(event *replication.BinlogEvent) bool

FilterTables ...

func FilterThreadID

func FilterThreadID(event *replication.BinlogEvent) bool

FilterThreadID ...

func InGTIDSet

func InGTIDSet(sid []byte, gno int64, gtidSet string) bool

InGTIDSet ...

func ParseEventHeader

func ParseEventHeader(buf []byte) (*replication.EventHeader, error)

ParseEventHeader parser event header, in go-mysql it's internal func, make it public

func TypeSwitcher

func TypeSwitcher(event *replication.BinlogEvent)

TypeSwitcher event router by type

func UpdateMasterInfo

func UpdateMasterInfo(event *replication.BinlogEvent)

UpdateMasterInfo ...

Types

type EncryptHeader

type EncryptHeader struct {
	Version   int
	KeyRingID []byte // keyring id
	Key       []byte // key raw bytes
	IV        []byte // 16 bytes
	Password  []byte // 32 bytes
}

type KeyRing

type KeyRing struct {
	Type   []byte
	KeyID  []byte
	UserID []byte
	Key    []byte
}

Jump to

Keyboard shortcuts

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