gh-ost/vendor/github.com/siddontang/go-mysql/mysql/gtid.go
2017-10-02 08:40:33 +03:00

28 lines
513 B
Go

package mysql
import "github.com/juju/errors"
type GTIDSet interface {
String() string
// Encode GTID set into binary format used in binlog dump commands
Encode() []byte
Equal(o GTIDSet) bool
Contain(o GTIDSet) bool
Update(GTIDStr string) error
}
func ParseGTIDSet(flavor string, s string) (GTIDSet, error) {
switch flavor {
case MySQLFlavor:
return ParseMysqlGTIDSet(s)
case MariaDBFlavor:
return ParseMariadbGTIDSet(s)
default:
return nil, errors.Errorf("invalid flavor %s", flavor)
}
}