package gtid import "sync" type Gtid struct { uuidNumbers []UUIDNumber hashMap map[string]int changed bool mu sync.RWMutex } type UUIDNumber struct { uuid string intervals []uuidRange } type uuidRange struct { min uint64 max uint64 } type SortUUID []UUIDNumber func (s SortUUID) Len() int { return len(s) } func (s SortUUID) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s SortUUID) Less(i, j int) bool { return s[i].uuid < s[j].uuid } type SortRange []uuidRange func (s SortRange) Len() int { return len(s) } func (s SortRange) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s SortRange) Less(i, j int) bool { return s[i].min < s[j].min }