{"id":26220674,"url":"https://github.com/mprot/msgpack-go","last_synced_at":"2025-04-16T04:31:43.777Z","repository":{"id":57607667,"uuid":"104630520","full_name":"mprot/msgpack-go","owner":"mprot","description":"A MessagePack implementation for Go.","archived":false,"fork":false,"pushed_at":"2024-01-15T14:35:10.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T04:51:16.315Z","etag":null,"topics":["go","golang","messagepack","msgpack","serialization"],"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/mprot.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":"2017-09-24T08:44:04.000Z","updated_at":"2023-02-17T22:54:12.000Z","dependencies_parsed_at":"2022-08-30T04:42:09.713Z","dependency_job_id":null,"html_url":"https://github.com/mprot/msgpack-go","commit_stats":null,"previous_names":["tsne/msgpack-go"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprot%2Fmsgpack-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprot%2Fmsgpack-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprot%2Fmsgpack-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprot%2Fmsgpack-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mprot","download_url":"https://codeload.github.com/mprot/msgpack-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249195292,"owners_count":21228164,"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":["go","golang","messagepack","msgpack","serialization"],"created_at":"2025-03-12T15:18:42.276Z","updated_at":"2025-04-16T04:31:43.759Z","avatar_url":"https://github.com/mprot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# msgpack-go\nmsgpack-go is a [MessagePack](http://msgpack.org/) implementation for the Go programming language.\n\n## Encoding\nTo encode values into the binary MessagePack format, an `Encode` function is provided:\n```Go\nfunc Encode(w io.Writer, v Encoder) error\n```\n`Encoder` describes an encodable type which fulfills the interface\n```Go\ntype Encoder interface {\n\tEncodeMsgpack(w *Writer) error\n}\n```\nand writes its value to the given writer. The `Writer` type provides a `Write*` method for each supported data type. For a complete overview of the `Writer` type, see the [documentation](https://godoc.org/github.com/mprot/msgpack-go#Writer).\n\n## Decoding\nTo decode binary MessagePack data into values, a `Decode` function is provided:\n```Go\nfunc Decode(r io.Reader, v Decoder) error\n```\n`Decoder` describes a decodable type which fulfills the interface\n```Go\ntype Decoder interface {\n\tDecodeMsgpack(r *Reader) error\n}\n```\nand reads the necessary values from the given reader. The `Reader` type provides a `Read*` method for each supported data type. Furthermore, a reader provides the following extra methods:\n* [Peek](https://godoc.org/github.com/mprot/msgpack-go#Reader.Peek) for looking up the next type in the stream without moving the read pointer, and\n* [Skip](https://godoc.org/github.com/mprot/msgpack-go#Reader.Skip) for skipping any value which comes next in the stream.\n\nFor a complete overview of the `Reader` type, see the [documentation](https://godoc.org/github.com/mprot/msgpack-go#Reader).\n\n## Example\n```Go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"log\"\n\n\tmsgpack \"github.com/mprot/msgpack-go\"\n)\n\ntype Custom struct {\n\tNumber  int\n\tBoolean bool\n}\n\nfunc (c *Custom) EncodeMsgpack(w *msgpack.Writer) error {\n\tif err := w.WriteInt(c.Number); err != nil {\n\t\treturn err\n\t}\n\treturn w.WriteBool(c.Boolean)\n}\n\nfunc (c *Custom) DecodeMsgpack(r *msgpack.Reader) (err error) {\n\tif c.Number, err = r.ReadInt(); err != nil {\n\t\treturn err\n\t}\n\tc.Boolean, err = r.ReadBool()\n\treturn err\n}\n\nfunc main() {\n\tvar buf bytes.Buffer\n\n\tencoded := \u0026Custom{Number: 7, Boolean: true}\n\tif err := msgpack.Encode(\u0026buf, encoded); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tdecoded := \u0026Custom{}\n\tif err := msgpack.Decode(\u0026buf, decoded); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif decoded.Number != encoded.Number || decoded.Boolean != encoded.Boolean {\n\t\tlog.Fatal(\"something went wrong\")\n\t}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmprot%2Fmsgpack-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmprot%2Fmsgpack-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmprot%2Fmsgpack-go/lists"}