Liking cljdoc? Tell your friends :D

puppetlabs.puppetdb.cheshire

Cheshire related functions

This front-ends the common set of core cheshire functions:

  • generate-string
  • generate-stream
  • parse
  • parse-strict
  • parse-string
  • parse-stream

This namespace when 'required' will also setup some common JSON encoders globally, so you can avoid doing this for each call.

Cheshire related functions

This front-ends the common set of core cheshire functions:

* generate-string
* generate-stream
* parse
* parse-strict
* parse-string
* parse-stream

This namespace when 'required' will also setup some common JSON encoders
globally, so you can avoid doing this for each call.
raw docstring

add-common-json-encoders!clj

Registers some common encoders for cheshire JSON encoding.

This is a memoize function, to avoid unnecessary calls to add-encoder.

Ideally this function should be called once in your apply, for example your main class.

Encoders currently include:

  • org.joda.time.DateTime - handled with to-string
Registers some common encoders for cheshire JSON encoding.

This is a memoize function, to avoid unnecessary calls to add-encoder.

Ideally this function should be called once in your apply, for example your
main class.

Encoders currently include:

* org.joda.time.DateTime - handled with to-string
sourceraw docstring

add-common-json-encoders!*clj

(add-common-json-encoders!*)

Non-memoize version of add-common-json-encoders!

Non-memoize version of add-common-json-encoders!
sourceraw docstring

byte-array-classclj

source

coerce-clj->json-byte-streamclj

(coerce-clj->json-byte-stream payload)

Converts clojure data to JSON serialized bytes on a ByteArrayInputStream. Cheshire will only output to writers and stockpile will only accept input streams, so some conversion needs to be done in this fn

Converts clojure data to JSON serialized bytes on a
ByteArrayInputStream. Cheshire will only output to writers and
stockpile will only accept input streams, so some conversion needs
to be done in this fn
sourceraw docstring

default-optsclj

source

default-pretty-optsclj

source

encoder-escaping-null-as-replacementclj

source

generate-pretty-streamclj

(generate-pretty-stream obj writer)
(generate-pretty-stream obj writer opts)

Thinly wraps cheshire.core/generate-stream, adding the PuppetDB default date format and pretty printing from default-pretty-opts

Thinly wraps cheshire.core/generate-stream, adding the PuppetDB default date format
and pretty printing from `default-pretty-opts`
sourceraw docstring

generate-pretty-stringclj

(generate-pretty-string obj)
(generate-pretty-string obj opts)

Thinly wraps cheshire.core/generate-string, adding the PuppetDB default date format and pretty printing from default-pretty-opts

Thinly wraps cheshire.core/generate-string, adding the PuppetDB
default date format and pretty printing from `default-pretty-opts`
sourceraw docstring

generate-streamclj

(generate-stream obj writer)
(generate-stream obj writer opts)

Thinly wraps cheshire.core/generate-stream, adding the PuppetDB default date format.

Thinly wraps cheshire.core/generate-stream, adding the PuppetDB
default date format.
sourceraw docstring

generate-stringclj

(generate-string obj)
(generate-string obj opts)

Thinly wraps cheshire.core/generate-string, adding the PuppetDB default date format.

Thinly wraps cheshire.core/generate-string, adding the PuppetDB
default date format.
sourceraw docstring

null-replacing-json-factoryclj

source

parseclj

(parse x)
(parse x key-fn)
(parse x key-fn array-coerce-fn)

Parses a string, byte-array, input-stream, or reader. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream and parse-string arguments. The top-level object will be parsed lazily if it's an array.

Parses a string, byte-array, input-stream, or reader.  key-fn and
array-coerce-fn match the corresponding Cheshire parse-stream and
parse-string arguments.  The top-level object will be parsed lazily
if it's an array.
sourceraw docstring

parse-streamclj

source

parse-strictclj

(parse-strict x)
(parse-strict x key-fn)
(parse-strict x key-fn array-coerce-fn)

Eagerly parses a string, byte-array, input-stream, or reader. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream and parse-string arguments, and the top-level object will not be parsed lazily if it's an array.

Eagerly parses a string, byte-array, input-stream, or reader.
key-fn and array-coerce-fn match the corresponding Cheshire
parse-stream and parse-string arguments, and the top-level object
will not be parsed lazily if it's an array.
sourceraw docstring

parse-strict-stringclj

source

parse-stringclj

source

parsed-seqclj

source

Parsercljprotocol

-parseclj

(-parse obj key-fn array-coerce-fn)

Parses obj. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream arguments.

Parses obj.  key-fn and array-coerce-fn match the corresponding
Cheshire parse-stream arguments.
source

spit-jsonclj

(spit-json f obj & options)

Similar to clojure.core/spit, but writes the Clojure datastructure as JSON to f

Similar to clojure.core/spit, but writes the Clojure
datastructure as JSON to `f`
sourceraw docstring

StrictParsercljprotocol

-parse-strictclj

(-parse-strict obj key-fn array-coerce-fn)

Eagerly parses obj. key-fn and array-coerce-fn match the corresponding Cheshire parse-stream arguments.

Eagerly parses obj.  key-fn and array-coerce-fn match the
corresponding Cheshire parse-stream arguments.
source

to-stringclj

source

writerclj

(writer f options)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close