Skip to content

nilenso/protoclj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

protoclj

A protobuf compiler for Clojure wrappers

Goals


  • All reflection done at compile time, so it's really fast
  • Play well with IOFactory, so that protobufs can be cast to and from InputStreams
  • Handle Nested Objects, Repeated Objects and Enums
  • Access fields by keywords

Usage


  • Add to project deps somehow
; Declare the functions key-value-pair and nested-object
; Sample1 is the root of the proto definition.
(defprotos sample1 Sample1
  key-value-pair  Sample1$KeyValuePair
  nested-object   Sample1$NestedObject)
  
(def object (key-value-pair {:key "foo" :value "bar"}))

(def back-to-map (mapify object)) ; -> {:key "foo" :value "bar"}

(clojure.java.io/input-stream object) ; -> BufferedInputStream (for ring)

About

A protobuf compiler for Clojure wrappers

Resources

License

Stars

Watchers

Forks

Packages

No packages published