Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface { Read(b []byte) (n int, err error) Write(b []byte) (n int, err error) Close() error }
Connection is a subset of net.Connection to allow testing
type Dialer ¶
type Dialer interface {
Dial(ctx context.Context) (Connection, error)
}
Dialer interface for open a new connection
type GTID ¶
type GTID struct { Domain uint32 `json:"domain"` ServerId uint32 `json:"server_id"` Sequence uint64 `json:"sequence"` }
GTID is the Mariadb Global Transaction ID https://mariadb.com/kb/en/library/gtid/
type GTIDExtractor ¶
GTIDExtractor decodes GTID from records
func NewGTIDExtractor ¶
func NewGTIDExtractor( format string, ) GTIDExtractor
type KafkaSender ¶
KafkaSender takes a channel of []byte and send them to the given topic
func NewKafkaSender ¶
func NewKafkaSender( producer sarama.SyncProducer, kafkaTopic string, gtidStore GTIDStore, gtidExtractor GTIDExtractor, ) KafkaSender
type MaxscaleReader ¶
type MaxscaleReader struct { Dialer Dialer User string Password string UUID string Format string // JSON or AVRO Database string Table string Version string }
MaxscaleReader of CDC messages from Maxscale
func (*MaxscaleReader) Read ¶
Read all cdc and send them to the given channel https://mariadb.com/resources/blog/how-to-stream-change-data-through-mariadb-maxscale-using-cdc-api/
type Reader ¶
type Reader interface { // Read changes and send them to the given channel Read(ctx context.Context, gtid *GTID, ch chan<- []byte) error }
Reader interface for the Streamer
type RetryReader ¶
RetryReader store the gtid of the last message and resume there on failure
func NewRetryReader ¶
func NewRetryReader( reader Reader, gtidExtractor GTIDExtractor, ) RetryReader
type TcpDialer ¶
type TcpDialer interface {
Dial(ctx context.Context) (Connection, error)
}
TcpDialer opens a TCP connection to the given address