Liking cljdoc? Tell your friends :D

catacumba.serializers

A friction-less and extensioble serializers abstraction layer.

The main public api consists in two functions:

  • encode: that takes the clojure data and the serialization format as keyword and returns serialized bytes.
  • decode: just does the reverse operation. It takes the a byte array and returns a deserialized data.

If something wrong is happens in the process, the underlying library used for serialize or deserialize can raise exceptions.

Here an simple example serializing and deserializing a clojure hash-map using json format:

(require '[catacumba.serializers :as sz])

(-> (sz/encode {:foo 2} :json)
    (sz/bytes->str))
;; => "{\"foo\": 2}"

(sz/decode some-data :json)
;; => {:foo 2}
A friction-less and extensioble serializers abstraction layer.

The main public api consists in two functions:

- `encode`: that takes the clojure data and the serialization format
  as keyword and returns serialized bytes.
- `decode`: just does the reverse operation. It takes the a byte array
  and returns a deserialized data.

If something wrong is happens in the process, the underlying library
used for serialize or deserialize can raise exceptions.

Here an simple example serializing and deserializing a clojure
hash-map using json format:

```
(require '[catacumba.serializers :as sz])

(-> (sz/encode {:foo 2} :json)
    (sz/bytes->str))
;; => "{\"foo\": 2}"

(sz/decode some-data :json)
;; => {:foo 2}
```
raw docstring

-decodecljmultimethod

source

-encodecljmultimethod

source

bytes->strclj

source

decodeclj

(decode data type)
(decode data type opts)

Encode data.

Encode data.
sourceraw docstring

encodeclj

(encode data type)
(encode data type opts)

Encode data.

Encode data.
sourceraw docstring

str->bytesclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close