{"id":18621258,"url":"https://github.com/sofastack/sofa-bolt-go","last_synced_at":"2026-03-05T22:34:13.342Z","repository":{"id":51251067,"uuid":"394631638","full_name":"sofastack/sofa-bolt-go","owner":"sofastack","description":"The Golang implementation of the SOFABolt protocol.","archived":false,"fork":false,"pushed_at":"2023-12-25T00:41:38.000Z","size":103,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-11T12:24:56.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sofastack.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-10T11:44:20.000Z","updated_at":"2024-04-12T10:11:21.000Z","dependencies_parsed_at":"2024-06-19T19:03:51.267Z","dependency_job_id":"1f309e83-af4e-4270-8710-44ba37b9eefe","html_url":"https://github.com/sofastack/sofa-bolt-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sofastack/sofa-bolt-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-bolt-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-bolt-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-bolt-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-bolt-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sofastack","download_url":"https://codeload.github.com/sofastack/sofa-bolt-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sofastack%2Fsofa-bolt-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-07T04:10:05.685Z","updated_at":"2026-03-05T22:34:13.309Z","avatar_url":"https://github.com/sofastack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sofa-bolt-go\nThe Golang implementation of the SOFABolt protocol.\n=======\n# TOC\n\n-   [synopsis](#synopsis)\n-   [example](#example)\n    -   [command](#command)\n    -   [client \u0026 server](#client---server)\n-   [cli](#cli)\n    -   [install](#install)\n    -   [decode](#decode)\n-   [benchmark](#benchmark)\n\n# synopsis\n\nsofa-bolt-go 是 [bolt 1.0/2.0 serialization protocol](https://www.sofastack.tech/projects/sofa-bolt/overview/) 以及 TBRemoting 的 Golang 实现，包含了客户端/服务端/编解码。\n\nsofa-bolt-go 提供三种类型的 API:\n\n-   command: 编解码 bolt 1.0/2.0 以及 TaobaoRemoting 协议。\n-   client: 发送请求并接受响应，同时也支持接受请求并写会响应。\n-   server: 解析请求并写会响应.\n\n# example\n\n## client \u0026 server\n\nSee [client_server_example_test.go](/examples/client_server_example_test.go#L12)\n\n## client \u0026 server with dialer\n\nSee [client_server_example_test.go](/examples/client_server_example_test.go#L67)\n\n## command\n\nSee [command_example_test.go](/sofabolt/command_example_test.go#L9)\n\n# cli\n\n## install\n\n`make build` 或者 `go get github.com/sofastack/sofa-bolt-go/cmd/bolt`\n\n## decode\n\n```bash\nbin/bolt decode 0100000200000000020000c80000000a0000000b0000000131000000013168656c6c6f20776f726c64\n```\n\n## decodeheader\n\n```bash\nbin/bolt decodeheader 00000018736f66615f686561645f7461726765745f736572766963650000001048656c6c6f536572766963653a312e300000001b7270635f74726163655f636f6e746578742e736f666152706349640000000130000000167270635f74726163655f636f6e746578742e73616d700000000566616c73650000001d7270635f74726163655f636f6e746578742e736f6661547261636549640000001e6139666531363839313537313239333033373932323130313233383031330000001f7270635f74726163655f636f6e746578742e736f666143616c6c6572496463000000000000001e7270635f74726163655f636f6e746578742e736f666143616c6c65724970000000000000001e7270635f74726163655f636f6e746578742e736f666150656e417474727300000000000000207270635f74726163655f636f6e746578742e736f666143616c6c65725a6f6e650000000000000014736f66615f686561645f7461726765745f617070000000000000000870726f746f636f6c00000004626f6c7400000007736572766963650000001048656c6c6f536572766963653a312e300000001d7270635f74726163655f636f6e746578742e73797350656e4174747273000000000000001f7270635f74726163655f636f6e746578742e736f666143616c6c65724170700000000000000015736f66615f686561645f6d6574686f645f6e616d650000000873617948656c6c6f\n```\n\n# benchmark\n\n```bash\npkg: github.com/sofastack/sofa-bolt-go/sofabolt\nBenchmarkClientConcurrent-8        \t  522289\t      1996 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkClient-8                  \t  281299\t      3987 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkReadTBRemotingRequest/request-8         \t  431926\t      2385 ns/op\t     384 B/op\t      19 allocs/op\nBenchmarkReadTBRemotingRequest/command-8         \t 8268426\t       145 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkWriteRequest-8                          \t29614092\t        39.3 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkWriteResponse-8                         \t17844903\t        64.0 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkServer/1_connection-8                   \t 2368573\t       505 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkServer/128_connection-8                 \t 1862937\t       786 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkServer/512_connection-8                 \t 3341610\t       343 ns/op\t       0 B/op\t       0 allocs/op\nBenchmarkServer/1024_connection-8                \t 5492541\t       212 ns/op\t       0 B/op\t       0 allocs/op\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofastack%2Fsofa-bolt-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsofastack%2Fsofa-bolt-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsofastack%2Fsofa-bolt-go/lists"}