GithubHelp home page GithubHelp logo

yangyangyang / binlog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from duzhanyuan/binlog

0.0 1.0 0.0 297 KB

binlog将自己伪装成slave获取mysql主从复杂流来获取mysql数据库的数据变更,提供轻量级,快速的dump协议交互以及binlog的row模式下的格式解析

License: Apache License 2.0

Go 98.69% Shell 0.07% Makefile 0.57% TSQL 0.67%

binlog's Introduction

binlog

Go Report Card Coverage Status Build Status GoDoc LICENSE

binlog将自己伪装成slave获取mysql主从复杂流来获取mysql数据库的数据变更,提供轻量级,快速的dump协议交互以及binlog的row模式下的格式解析

Features

  • 轻量级,快速的dump协议交互以及binlog的row模式格式解析
  • 支持mysql5.6以及mysql5.7除了JSON的所有数据类型变更
  • 支持使用完整dump协议连接数据库并接受binlog数据
  • 提供函数来接受解析后完整的事务数据
  • 事务数据提供变更的列名,列数据类型,bytes类型的数据

Requests

  • mysql 5.6/mysql 5.7
  • golang 1.9+

Installation

go get github.com/onlyac0611/binlog

Quick Start

Prepare

  • 对于自建MySQL,需要先开启Binlog写入功能,配置binlog-format为ROW模式
  • 授权examle链接MySQL账号具有作为MySQL slave的权限,如果已有账户可直接grant

Coding

  • 检查mysql的binlog格式是否是row模式,并且获取一个正确的binlog位置(以文件名和位移量作定义)
  • 实现MysqlTableMapper接口,该接口是用于获取表信息的,主要是获取列属性
  • 表MysqlTable和列MysqlColumn需要实现,用于MysqlTableMapper接口
  • 生成一个RowStreamer,设置一个正确的binlog位置并使用Stream接受数据,具体可以使用sendTransaction进行具体的行为定义

See the binlogStream and documentation for more details.

binlog's People

Contributors

breeze0806 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.