{"id":15100950,"url":"https://github.com/lpx-e5bd8/go-mysql-binlog","last_synced_at":"2025-12-15T01:59:58.288Z","repository":{"id":57521859,"uuid":"148988710","full_name":"LPX-E5BD8/go-mysql-binlog","owner":"LPX-E5BD8","description":"MySQL binary log analyzer in Golang.","archived":false,"fork":false,"pushed_at":"2022-03-18T15:35:16.000Z","size":29529,"stargazers_count":21,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T23:09:31.121Z","etag":null,"topics":["binlog","golang","mysql","mysqlbinlog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LPX-E5BD8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-16T11:24:35.000Z","updated_at":"2024-10-24T04:11:53.000Z","dependencies_parsed_at":"2022-08-26T23:40:41.334Z","dependency_job_id":null,"html_url":"https://github.com/LPX-E5BD8/go-mysql-binlog","commit_stats":null,"previous_names":["lpx-e5bd8/go-mysql-binlog","liipx/go-mysql-binlog","lpx-j0hko/go-mysql-binlog"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPX-E5BD8%2Fgo-mysql-binlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPX-E5BD8%2Fgo-mysql-binlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPX-E5BD8%2Fgo-mysql-binlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LPX-E5BD8%2Fgo-mysql-binlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LPX-E5BD8","download_url":"https://codeload.github.com/LPX-E5BD8/go-mysql-binlog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975316,"owners_count":21192210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binlog","golang","mysql","mysqlbinlog"],"created_at":"2024-09-25T18:04:07.689Z","updated_at":"2025-12-15T01:59:58.239Z","avatar_url":"https://github.com/LPX-E5BD8.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-mysql-binlog\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/liipx/go-mysql-binlog/blob/master/LICENSE) \n[![Go Report Card](https://goreportcard.com/badge/github.com/liipx/go-mysql-binlog)](https://goreportcard.com/report/github.com/liipx/go-mysql-binlog)\n\n\nMySQL binary log analyzer in Golang.\n\n[中文说明](https://github.com/liipx/go-mysql-binlog/blob/master/doc/doc_zh.md)\n\n## Example\n```go\nfunc main() {\n\tdecoder, err := binlog.NewBinFileDecoder(\"./testdata/mysql-bin.000004\")\n\tif err != nil {\n\t\tpanic(err)\n\t\treturn\n\t}\n    \n\tnum := 0\n\tmaxEventCount := 0\n\terr = decoder.WalkEvent(func(event *binlog.BinEvent) (isContinue bool, err error) {\n\t\tfmt.Printf(\"Got %s: \\n\\t\", binlog.EventType2Str[event.Header.EventType])\n\t\tfmt.Println(event.Header)\n\t\t\n\t\t// show details if you need\n\t\t// if event.Body != nil {\n\t\t// \tpretty.Println(event.Body)\n\t\t// }\n\t\t//\n\t\t\n\t\tfmt.Println(strings.Repeat(\"=\", 100))\n\t\tcount ++\n\t\treturn maxEventCount \u003e num || maxEventCount == 0, nil\n\t}, nil)\n    \n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n}\n```\n### Output:\n```text\nGot FORMAT_DESCRIPTION_EVENT: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:119, LogPos:123, Flag:0x1\n====================================================================================================\nGot PREVIOUS_GTIDS_EVENT: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:31, LogPos:154, Flag:0x80\n====================================================================================================\nGot ANONYMOUS_GTID_EVENT: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:65, LogPos:219, Flag:0x0\n====================================================================================================\nGot QUERY_EVENT: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:79, LogPos:298, Flag:0x8\n====================================================================================================\nGot TABLE_MAP_EVENT: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:64, LogPos:362, Flag:0x0\n====================================================================================================\nGot WRITE_ROWS_EVENTv2: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:197, LogPos:559, Flag:0x0\n====================================================================================================\nGot XID_EVENT: \n\tTime:2018-09-22 18:24:30 +0800 CST, ServerID:1537611870, EventSize:31, LogPos:590, Flag:0x0\n====================================================================================================\n\n```\n\n## Progress\n|EventType|Supported|\n|---|---|\n|UNKNOWN_EVENT|✔|\n|START_EVENT_V3||\n|QUERY_EVENT|✔|\n|STOP_EVENT||\n|ROTATE_EVENT|✔|\n|INTVAR_EVENT|✔|\n|LOAD_EVENT||\n|SLAVE_EVENT||\n|CREATE_FILE_EVENT||\n|APPEND_BLOCK_EVENT||\n|EXEC_LOAD_EVENT||\n|DELETE_FILE_EVENT||\n|NEW_LOAD_EVENT||\n|RAND_EVENT||\n|USER_VAR_EVENT||\n|FORMAT_DESCRIPTION_EVENT|✔|\n|XID_EVENT|✔|\n|BEGIN_LOAD_QUERY_EVENT||\n|EXECUTE_LOAD_QUERY_EVENT||\n|TABLE_MAP_EVENT|✔|\n|WRITE_ROWS_EVENTv0||\n|UPDATE_ROWS_EVENTv0||\n|DELETE_ROWS_EVENTv0||\n|WRITE_ROWS_EVENTv1||\n|UPDATE_ROWS_EVENTv1||\n|DELETE_ROWS_EVENTv1||\n|INCIDENT_EVENT||\n|HEARTBEAT_EVENT||\n|IGNORABLE_EVENT||\n|ROWS_QUERY_EVENT||\n|WRITE_ROWS_EVENTv2||\n|UPDATE_ROWS_EVENTv2||\n|DELETE_ROWS_EVENTv2||\n|GTID_EVENT|✔|\n|ANONYMOUS_GTID_EVENT|✔|\n|PREVIOUS_GTIDS_EVENT|✔|\n\n## TODO\n1. Support all mysql binlog event.\n1. Get binlog event through network connections.\n1. Multi threads binlog dumper.\n1. Flash back base on row format binary log.\n1. more.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpx-e5bd8%2Fgo-mysql-binlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpx-e5bd8%2Fgo-mysql-binlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpx-e5bd8%2Fgo-mysql-binlog/lists"}