mysqlbinlog/parse_test.go
2023-05-24 15:25:31 +08:00

29 lines
534 B
Go

package binlog
import (
"fmt"
"testing"
"time"
)
func TestParse(t *testing.T) {
ParseBinlogFile("./test/mysql-bin.000023", func(transaction Transaction) {
fmt.Println(transaction)
})
}
func TestParseFilter(t *testing.T) {
ParseBinlogWithFilter("./test/mysql-bin.000023", 0, BinlogFilter{
IncludeGtid: "",
ExcludeGtid: "",
StartPos: 0,
EndPos: 0,
StartDate: time.Time{},
EndDate: time.Time{},
BigThan: 0,
SmallThan: 0,
}, func(transaction Transaction) {
fmt.Println(transaction)
})
}