File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 55go build -o bin/go-mysqlbinlog cmd/go-mysqlbinlog/main.go
66go build -o bin/go-mysqldump cmd/go-mysqldump/main.go
77go build -o bin/go-canal cmd/go-canal/main.go
8+ go build -o bin/go-binlogparser cmd/go-binlogparser/main.go
89rm -rf vendor
910
1011test :
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import (
4+ "flag"
5+ "os"
6+
7+ "github.com/siddontang/go-mysql/replication"
8+ )
9+
10+ var name = flag .String ("name" , "" , "binlog file name" )
11+ var offset = flag .Int64 ("offset" , 0 , "parse start offset" )
12+
13+ func main () {
14+ flag .Parse ()
15+
16+ p := replication .NewBinlogParser ()
17+
18+ f := func (e * replication.BinlogEvent ) error {
19+ e .Dump (os .Stdout )
20+ return nil
21+ }
22+
23+ err := p .ParseFile (* name , * offset , f )
24+
25+ if err != nil {
26+ println (err )
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments