{"id":17359036,"url":"https://github.com/zishang520/engine.io-go-parser","last_synced_at":"2025-04-15T00:10:54.764Z","repository":{"id":170912536,"uuid":"647175750","full_name":"zishang520/engine.io-go-parser","owner":"zishang520","description":"engine.io packet parser for golang.","archived":false,"fork":false,"pushed_at":"2025-03-20T06:42:21.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T12:11:09.331Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zishang520.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T08:12:20.000Z","updated_at":"2025-03-20T06:11:28.000Z","dependencies_parsed_at":"2024-05-29T16:35:23.482Z","dependency_job_id":"0a754955-46ef-44ba-ac43-9f93fbd5367a","html_url":"https://github.com/zishang520/engine.io-go-parser","commit_stats":null,"previous_names":["zishang520/engine.io-go-parser"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-go-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-go-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-go-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zishang520%2Fengine.io-go-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zishang520","download_url":"https://codeload.github.com/zishang520/engine.io-go-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981270,"owners_count":21193147,"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":[],"created_at":"2024-10-15T19:07:51.632Z","updated_at":"2025-04-15T00:10:54.756Z","avatar_url":"https://github.com/zishang520.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# engine.io-go-parser\n\n[![Go](https://github.com/zishang520/engine.io-go-parser/actions/workflows/go.yml/badge.svg)](https://github.com/zishang520/engine.io-go-parser/actions/workflows/go.yml)\n[![GoDoc](https://pkg.go.dev/badge/github.com/zishang520/engine.io-go-parser?utm_source=godoc)](https://pkg.go.dev/github.com/zishang520/engine.io-go-parser)\n\nThis is the golang parser for the engine.io protocol encoding,\nshared by both\n[engine.io-client-go(not ready)](https://github.com/zishang520/engine.io-client-go) and\n[engine.io](https://github.com/zishang520/engine.io).\n\n## How to use\n\n### Standalone\n\nThe parser can encode/decode packets, payloads, and payloads as binary\nwith the following methods: `Parser.EncodePacket`, `Parser.DecodePacket`, `Parser.EncodePayload`,\n`Parser.DecodePayload`.\n\nExample:\n\n```go\nimport (\n    \"bytes\"\n    \"io\"\n    \"strings\"\n\n    \"github.com/zishang520/engine.io-go-parser/packet\"\n    \"github.com/zishang520/engine.io-go-parser/types\"\n)\n\nfunc main() {\n    p := \u0026packet.Parserv4()\n\n    data, _ := p.EncodePacket(\u0026packet.Packet{\n        Type:    packet.MESSAGE,\n        Data:    bytes.NewBuffer([]byte{1, 2, 3, 4}),\n        Options: nil,\n    }, true)\n    decodedData, _ := p.DecodePacket(data)\n}\n```\n\n## API\n\n### Parser interface\n\n- `EncodePacket`\n    - Encodes a packet.\n    - **Parameters**\n      - `*packet.Packet`: the packet to encode.\n      - `bool`: binary support.\n      - `bool`: utf8 encode, v3 only.\n- `DecodePacket`\n    - **Parameters**\n      - `types.BufferInterface`: the packet to decode.\n      - `bool`: utf8 encode, v3 only.\n\n- `EncodePayload`\n    - Encodes multiple messages (payload).\n    - If any contents are binary, they will be encoded as base64 strings. Base64\n      encoded strings are marked with a b before the length specifier\n    - **Parameters**\n      - `[]*packet.Packet`: an array of packets\n      - `bool`: binary support, v3 only.\n- `DecodePayload`\n    - Decodes data when a payload is maybe expected. Possible binary contents are\n      decoded from their base64 representation.\n    - **Parameters**\n      - `types.BufferInterface`: the payload\n\n## Tests\n\nStandalone tests can be run with `make test` which will run the golang tests.\n\nYou can run the tests locally using the following command:\n\n```\nmake test\n```\n\n## Support\n\n[issues](https://github.com/zishang520/engine.io-go-parser/issues)\n\n## Development\n\nTo contribute patches, run tests or benchmarks, make sure to clone the\nrepository:\n\n```bash\ngit clone git://github.com/zishang520/engine.io-go-parser.git\n```\n\nThen:\n\n```bash\ncd engine.io-go-parser\nmake test\n```\n\nSee the `Tests` section above for how to run tests before submitting any patches.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzishang520%2Fengine.io-go-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzishang520%2Fengine.io-go-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzishang520%2Fengine.io-go-parser/lists"}