Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectAllBinlogFiles ¶
CollectAllBinlogFiles collects all valid binlog files in dir
Types ¶
type BinlogReader ¶
type BinlogReader struct {
// contains filtered or unexported fields
}
BinlogReader is a binlog reader.
func NewBinlogReader ¶
func NewBinlogReader(tctx *tcontext.Context, cfg *BinlogReaderConfig) *BinlogReader
NewBinlogReader creates a new BinlogReader
type BinlogReaderConfig ¶
BinlogReaderConfig is the configuration for BinlogReader
type LocalStreamer ¶
type LocalStreamer struct {
// contains filtered or unexported fields
}
LocalStreamer reads and parses binlog events from local binlog file.
func (*LocalStreamer) GetEvent ¶
func (s *LocalStreamer) GetEvent(ctx context.Context) (*replication.BinlogEvent, error)
GetEvent gets the binlog event one by one, it will block until parser occurs some errors. You can pass a context (like Cancel or Timeout) to break the block.
type ReaderHub ¶
type ReaderHub struct {
// contains filtered or unexported fields
}
ReaderHub holds information for all active Readers
func GetReaderHub ¶
func GetReaderHub() *ReaderHub
GetReaderHub gets singleton instance of ReaderHub
func (*ReaderHub) EarliestActiveRelayLog ¶
func (h *ReaderHub) EarliestActiveRelayLog() *RelayLogInfo
EarliestActiveRelayLog implements RelayOperator.EarliestActiveRelayLog
func (*ReaderHub) RemoveActiveRelayLog ¶
RemoveActiveRelayLog removes active relay log for taskName
func (*ReaderHub) UpdateActiveRelayLog ¶
UpdateActiveRelayLog updates active relay log for taskName
type RelayLogInfo ¶
RelayLogInfo represents information for relay log
func (*RelayLogInfo) Earlier ¶
func (info *RelayLogInfo) Earlier(other *RelayLogInfo) bool
Earlier checks whether this relay log file is earlier than the other
func (*RelayLogInfo) String ¶
func (info *RelayLogInfo) String() string
String implements Stringer.String
type Streamer ¶
type Streamer interface { // GetEvent returns binlog event GetEvent(ctx context.Context) (*replication.BinlogEvent, error) }
Streamer provides the ability to get binlog event from remote server or local file.