{"id":39430608,"url":"https://github.com/everfore/bconv","last_synced_at":"2026-01-18T04:03:18.227Z","repository":{"id":35705209,"uuid":"39982743","full_name":"everfore/bconv","owner":"everfore","description":"Bson \u0026 Json Bytes Convert","archived":false,"fork":false,"pushed_at":"2018-04-02T02:37:06.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T20:21:44.905Z","etag":null,"topics":[],"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/everfore.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":"2015-07-31T02:35:47.000Z","updated_at":"2019-07-29T10:47:34.000Z","dependencies_parsed_at":"2022-08-17T22:05:12.576Z","dependency_job_id":null,"html_url":"https://github.com/everfore/bconv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/everfore/bconv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everfore%2Fbconv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everfore%2Fbconv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everfore%2Fbconv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everfore%2Fbconv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/everfore","download_url":"https://codeload.github.com/everfore/bconv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/everfore%2Fbconv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28529455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-01-18T04:03:18.170Z","updated_at":"2026-01-18T04:03:18.219Z","avatar_url":"https://github.com/everfore.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \tbconv [![](http://gocover.io/_badge/github.com/everfore/bconv)](http://gocover.io/github.com/everfore/bconv)\n\nBson \u0026 Json Bytes Convert\n\n----------------------------------\n\n##\tGet\n\n\t\tgo get github.com/everfore/bconv\n\n###\t\t3rd party pkg \n\n\t\tgo get labix.org/v2/mgo/bson\n\n##\tDefine\n\njson represents for interface{}, for instance struct, map, slice.\n\nbson represents for bson.M, actually which is a map[string]interface{}.\n\n## \tConvert Conclusion\n\n###\t\tjson \u003c----\u003e bson\n\njson to bson, using bson.Marshal\n\nbson to json, using json.Marshal\n\n###\t\tjsonbytes \u003c--X--\u003e bsonbytes\n\nWell, jsonbytes do not equal bsonbytes. They are different []byte.\n\nWe can not use string(bsonbytes) as string.\n\n##\t\tUsage\n\n###\t\tInit\n\n\t\tvar testBson = \u0026bson.M{\n\t\t\t\"Name\": \"Golang\",\n\t\t}\n\n\t\tb := NewBson(testBson)\n\n\n\t\ttype Lang struct {\n\t\t\tName string\n\t\t}\n\n\t\tvar testJson = \u0026Lang{\n\t\t\tName: \"Golang ?\",\n\t\t}\n\n\t\tj := NewJson(testJson)\n\n\n###\t\tBson\n\n\t\tb := NewBson(testBson)\n\n\t\tbbbs := b.BBytes()\n\t\tt.Log(bbbs)\n\n\t\tbjbs := b.JBytes()\n\t\tt.Log(bjbs)\n\n\t\tbj := b.Json()\n\t\tt.Log(bj)\n\n###\t\tJson\n\n\t\tj := NewJson(testJson)\n\n\t\tjbbs := j.BBytes()\n\t\tt.Log(jbbs)\n\n\t\tjjbs := j.JBytes()\n\t\tt.Log(jjbs)\n\n\t\tjb := j.Bson()\n\t\tt.Log(jb)\n\n###\t\tConv\n\t\n\ttype Java struct {\n\t\tName string\n\t}\n\n\tvar java Java\n\n1.\tJson Conv\n\n\terr := j.Conv(\u0026java)\n\n\terr := b.Json().Conv(\u0026java)\n\n2.\tBson Conv\n\n\terr := j.Bson().Conv(\u0026java)\n\t\n\terr := b.Conv(\u0026java)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverfore%2Fbconv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feverfore%2Fbconv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feverfore%2Fbconv/lists"}