Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

46
vendor/github.com/siddontang/go-mysql/canal/master.go generated vendored Normal file
View File

@@ -0,0 +1,46 @@
package canal
import (
"sync"
"github.com/siddontang/go-mysql/mysql"
log "github.com/sirupsen/logrus"
)
type masterInfo struct {
sync.RWMutex
pos mysql.Position
gtid mysql.GTIDSet
}
func (m *masterInfo) Update(pos mysql.Position) {
log.Debugf("update master position %s", pos)
m.Lock()
m.pos = pos
m.Unlock()
}
func (m *masterInfo) UpdateGTID(gtid mysql.GTIDSet) {
log.Debugf("update master gtid %s", gtid.String())
m.Lock()
m.gtid = gtid
m.Unlock()
}
func (m *masterInfo) Position() mysql.Position {
m.RLock()
defer m.RUnlock()
return m.pos
}
func (m *masterInfo) GTID() mysql.GTIDSet {
m.RLock()
defer m.RUnlock()
return m.gtid
}