{"id":20634133,"url":"https://github.com/samn/pitbull","last_synced_at":"2025-08-16T16:07:46.879Z","repository":{"id":11627077,"uuid":"14127002","full_name":"samn/pitbull","owner":"samn","description":"Clojure Protocol Buffers","archived":false,"fork":false,"pushed_at":"2014-09-13T20:50:39.000Z","size":324,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T09:55:53.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-04T23:40:03.000Z","updated_at":"2023-12-26T17:26:02.000Z","dependencies_parsed_at":"2022-08-31T22:52:10.930Z","dependency_job_id":null,"html_url":"https://github.com/samn/pitbull","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/samn/pitbull","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fpitbull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fpitbull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fpitbull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fpitbull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samn","download_url":"https://codeload.github.com/samn/pitbull/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samn%2Fpitbull/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270735041,"owners_count":24636289,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"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":"2024-11-16T14:23:56.654Z","updated_at":"2025-08-16T16:07:46.853Z","avatar_url":"https://github.com/samn.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pitbull\n\nClojure Protocol Buffers\n\n\n\n### [Pitbull](https://en.wikipedia.org/wiki/Pitbull_%28rapper%29) \nis a rapper.\n\n###[pitbull](https://en.wikipedia.org/wiki/Pitbull)\nis a wrapper around Protocol Buffer objects that exposes an `IPersistentMap`-like interface.\n\n## Installation\n\npitbull is available on [Clojars](https://clojars.org/pitbull).\n\n\n\t[pitbull \"0.1.3\"]\n\n\n## Usage\n\n*See [the docs](https://github.com/samn/pitbull/blob/master/doc/intro.md)*\n\nGiven a Protocol Buffer Message:\n\n\tpackage Pets;\n\toption java_package = \"com.pets\";\n\n\tmessage Bear {\n    \trequired string name = 1;\n\t    optional bool hungry = 2;\n\t}\n\t\nthat has been used to generate a Java class (`com.pets.Pets$Bear`).\n\n\t(require '[pitbull :as pb])\n\t(import '[com.pets Pets$Bear])\n\nYou can create a new wrapped `Pets$Bear` instance from a regular `Map`:\n\t\n\t(def bear-map {:name \"yogi\" :hungry true})\n\t(def bear-protobuf-map (pb/map-\u003eProtobufMap Pets$Bear bear-map))\n\t\n\t(:name bear-protobuf-map) ; =\u003e \"yogi\"\n\t;; fields can be accessed using String or Keyword keys\n\t(get bear-protobuf-map \"hungry\") ; =\u003e true\n\t\nA `ProtobufMap` will throw an `IllegalArgumentException` if a key that doesn't exist on the Protobuf definition is added:\n\n\t(assoc bear-protobuf-map :color \"brown\") ; =\u003e IllegalArgumentException\n\t\nor if a key that isn't present on the protobuf definition is read:\n\n\t(get bear-protobuf-map \"dogs\") ; =\u003e IllegalArgumentException\n\nAn Exception will be thrown if you try to create a `ProtobufMap` with an invalid key, or if a required field is missing:\n\n\t(pb/map-\u003eProtobufMap Pets$Bear {:hungry false}) ; =\u003e com.google.protobuf.UninitializedMessageException\n\t(pb/map-\u003eProtobufMap Pets$Bear {:name \"boo boo\" :size \"small\"}) ; =\u003e IllegalArgumentException\n\t\nYou can serialize a `ProtobufMap` to a given `OutputStream`\n\t\n\t(pb/serialize-to bear-protobuf-map (java.io.FileOutputStream \"yogi.bear\"))\n\t\nA convenience function is provided to serialize directly to a byte array:\n\n\t(pb/serialize-to-bytes bear-protobuf-map)\n\t\nOr even a Map directly to a byte-array (or vice versa):\n\n\t(-\u003e\u003e {:name \"Misha\"}\n\t\t (pb/map-\u003eproto-bytes Pets$Bear)\n\t\t (bytes-\u003eProtobufMap Pets$Bear))\n\n## Build Status\n\n[![Travis CI](https://api.travis-ci.org/samn/pitbull.png)](https://travis-ci.org/samn/pitbull)\n\n\n## [Pitbulls](https://en.wikipedia.org/wiki/Pitbull) \n\nare the best kind of dog.  If you could be a good guardian you should consider adopting one.\n![so cute!](https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/American_Pit_Bull_Terrier_-_Seated.jpg/443px-American_Pit_Bull_Terrier_-_Seated.jpg)\n\n## License\n\nCopyright © 2013 @samn\n\nDistributed under the Eclipse Public License, the same as Clojure.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamn%2Fpitbull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamn%2Fpitbull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamn%2Fpitbull/lists"}