47d49c6b92
* Add a go.mod file * run go mod vendor again * Move to a well-supported ini file reader * Remove GO111MODULE=off * Use go 1.16 * Rename github.com/outbrain/golib -> github.com/openark/golib * Remove *.go-e files * Fix for `strconv.ParseInt: parsing "": invalid syntax` error * Add test for '[osc]' section Co-authored-by: Nate Wernimont <nate.wernimont@workiva.com>
30 lines
534 B
Go
30 lines
534 B
Go
package mysql
|
|
|
|
import "github.com/pingcap/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
|
|
|
|
Clone() GTIDSet
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|