gh-ost/vendor/github.com/go-mysql-org/go-mysql/mysql/gtid.go

30 lines
534 B
Go
Raw Normal View History

2016-06-16 09:15:56 +00:00
package mysql
import "github.com/pingcap/errors"
2016-06-16 09:15:56 +00:00
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
Clone() GTIDSet
2016-06-16 09:15:56 +00:00
}
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)
}
}