binlog.go 517 B

12345678910111213141516171819202122232425262728293031
  1. package binlog
  2. import "fmt"
  3. func (c *Conn) startBinLogStream() error {
  4. bldc := &BinLogDumpCommand{
  5. Status: COMMAND_BIN_LOG_DUMP,
  6. Position: 120,
  7. Flags: BINLOG_DUMP_NON_BLOCK,
  8. ServerId: c.Config.ServerId,
  9. Filename: c.Config.BinLogFile,
  10. }
  11. return c.writeBinLogDumpCommand(bldc)
  12. }
  13. func (c *Conn) listenForBinlog() error {
  14. res, err := c.listen()
  15. if err != nil {
  16. return err
  17. }
  18. fmt.Printf("res = %+v\n", res)
  19. // err = c.listenForBinlog()
  20. // if err != nil {
  21. // return err
  22. // }
  23. return nil
  24. }