{"id":23435268,"url":"https://github.com/erikpelli/sbor","last_synced_at":"2025-04-09T17:30:03.094Z","repository":{"id":107126229,"uuid":"460514298","full_name":"ErikPelli/sbor","owner":"ErikPelli","description":"MessagePack - Serializer to Binary Object Representation","archived":false,"fork":false,"pushed_at":"2022-03-30T20:14:10.000Z","size":306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T03:43:25.607Z","etag":null,"topics":["go","messagepack","serialization"],"latest_commit_sha":null,"homepage":"","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/ErikPelli.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":"2022-02-17T16:23:31.000Z","updated_at":"2022-03-08T16:09:30.000Z","dependencies_parsed_at":"2023-05-17T08:46:44.914Z","dependency_job_id":null,"html_url":"https://github.com/ErikPelli/sbor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikPelli%2Fsbor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikPelli%2Fsbor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikPelli%2Fsbor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErikPelli%2Fsbor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErikPelli","download_url":"https://codeload.github.com/ErikPelli/sbor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248077024,"owners_count":21043881,"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","messagepack","serialization"],"created_at":"2024-12-23T12:50:10.681Z","updated_at":"2025-04-09T17:30:03.034Z","avatar_url":"https://github.com/ErikPelli.png","language":"Go","readme":"# MessagePack serializer in Go\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/ErikPelli/sbor)](https://goreportcard.com/report/github.com/ErikPelli/sbor)\n[![CodeQL](https://github.com/ErikPelli/sbor/actions/workflows/codeql.yml/badge.svg)](https://github.com/ErikPelli/sbor/actions/workflows/codeql.yml)\n[![Linter](https://github.com/ErikPelli/sbor/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/ErikPelli/sbor/actions/workflows/golangci-lint.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/ErikPelli/sbor.svg)](https://pkg.go.dev/github.com/ErikPelli/sbor)\n[![codecov](https://codecov.io/gh/ErikPelli/sbor/branch/master/graph/badge.svg?token=bK8mgSNKwF)](https://codecov.io/gh/ErikPelli/sbor)\n\n[SBOR](https://github.com/ErikPelli/sbor) is a modern and straightforward MessagePack serializer written completely in\nGo, without the use of code that use \"unsafe\" package and thus preserving the cross-compilation characteristics of the\nlanguage.\n\nThe aim of the project is to make a library that balances the performance with the _ease of use_. Its code must be easy\nand understandable, and the tests must be adequate, with unit test code coverage greater than 95%.\n\n## Resources\n\n- [Reference](https://pkg.go.dev/github.com/ErikPelli/sbor)\n- [Examples](https://pkg.go.dev/github.com/ErikPelli/sbor#pkg-examples)\n\n## What is MessagePack?\n\nMessagePack is an efficient binary serialization format that lets you exchange data among multiple languages, like JSON,\nbut it's faster and smaller, and provide support to custom types defined by the user, called extension. In addition, it\nsupports the transmission of raw bytes, unlike JSON. If you are curious, check\nits [specification](https://github.com/msgpack/msgpack/blob/master/spec.md).\nMessagePack is not human-readable directly.\n\n## Meaning of the project name\n\nSBOR is an acronym that stands for Serializer to Binary Object Representation, to use a short name for the library and\nhighlight the fact that the format is binary. Moreover, in the Czech language this word means \"choir\", and this could\nrepresent the set of different functions that compose the library and that work together to provide the correct output.\n\nContrary to what the name might say, this project currently has no connection with CBOR format, but potential support in\nthe future for that too, as some of its features are similar to MessagePack, should not be ruled out.\n\n## Installation\n\nYou can install this library using:\n\n```\ngo get github.com/ErikPelli/sbor\n```\n\nAt the moment it's still in unstable version.\n\n## Features\n\n- Encoding of primitives, time.Time, arrays, slices, maps, structs and value contained in an interface\n- Encoding of struct as an array or as a map (key value)\n- Omit only specified fields using sbor:\"-\"\n- Renaming of fields using sbor:\"new_field_name\"\n- Support for every type as the key (it could be an integer, a map, an array, etc.), using custom keys\n\n## TODO\n\n- Cache intermediate results to avoid repetition of certain operations when encoding\n- Decode from MessagePack bytes to Go data types\n\n## Quickstart\n\nPlease read carefully the documentation contained in reference to learn more about the available functions.\n\n```go\npackage example\n\nimport (\n\t\"fmt\"\n\t\"github.com/ErikPelli/sbor\"\n)\n\nfunc StructMarshalExample() {\n\ttype Test struct {\n\t\tKeys  map[string][]byte `sbor:\",setcustomkeys\"`\n\t\tHello string            `sbor:\",customkey\"`\n\t}\n\t\n\ts := Test{\n\t\tKeys: map[string][]byte{\"Hello\" : {0xCC, 0x11, 0xAA, 0x00}},\n\t\tHello: \"world\",\n\t}\n\n\tresult, err := sbor.Marshal(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t\n\t// Byte slice result equivalent to:\n\t// {\n\t//      [0xCC, 0x11, 0xAA, 0x00]: \"world\"\n\t// }\n\tfmt.Println(result)\n}\n```\n\n## License\n\nThis project is licensed under the MIT License. See [LICENSE](https://github.com/ErikPelli/sbor/blob/master/LICENSE) for\nthe full license text.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikpelli%2Fsbor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferikpelli%2Fsbor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferikpelli%2Fsbor/lists"}