Move parser code to it's own package

This commit is contained in:
2018-11-05 18:15:59 +01:00
parent 93f9ee8b52
commit 3a5271bca3
13 changed files with 182 additions and 80 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ import (
"os"
"time"
"github.com/localhots/blt"
"github.com/localhots/blt/parser"
"github.com/localhots/gobelt/log"
)
@@ -22,13 +22,13 @@ func main() {
validate((*dsn != ""), "Database source name is not set")
validate((*id != 0), "Server ID is not set")
validate((*file != ""), "Binary log file is not set")
conf := blt.Config{
conf := parser.Config{
ServerID: uint32(*id),
File: *file,
Offset: uint32(*offset),
}
reader, err := blt.Connect(*dsn, conf)
reader, err := parser.Connect(*dsn, conf)
if err != nil {
log.Fatalf(ctx, "Failed to establish connection: %v", err)
}