binlog.go 539 B

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