Liking cljdoc? Tell your friends :D

scribe.avro.core

Functions for Clojure Spec to Avro schema conversion, encoding and decoding.

Functions for Clojure Spec to Avro schema conversion, encoding and decoding.
raw docstring

->avro-schemaclj

(->avro-schema spec-k)

Generates an Avro schema for spec-k.

spec-k: the key of the Spec to convert

Generates an Avro schema for `spec-k`.

`spec-k`: the key of the Spec to convert
raw docstring

->avro-schema*cljmultimethod

Returns a tuple: [::spec->avro-ref ::avro-schema].

The ::spec->avro-ref map is updated in any calls that define Avro named types, so that schemas are only defined on the first instance and then referred to by fully qualified name.

NOTE: you shouldn't need to call this directly, but you can extend this multimethod to implement schema generation for specs that aren't included here.

Returns a tuple: [`::spec->avro-ref` `::avro-schema`].

The `::spec->avro-ref` map is updated in any calls that define Avro named
types, so that schemas are only defined on the first instance and then
referred to by fully qualified name.

NOTE: you shouldn't need to call this directly, but you can extend this
multimethod to implement schema generation for specs that aren't included
here.
raw docstring

binary-encodedclj

(binary-encoded spec-k & records)

See abracad.avro/binary-encoded.

See `abracad.avro/binary-encoded`.
raw docstring

decodeclj

(decode spec-k source)

See abracad.avro/decode.

See `abracad.avro/decode`.
raw docstring

enum?clj

(enum? x)

Specs defined as non-empty, keyword-only sets are ::enums.

::enums are used for defining a finite set of choices and are converted to Avro :enums. An example would be:

`(s/def ::color #{:red :green :blue})'

Specs defined as non-empty, keyword-only sets are `::enum`s.

`::enum`s are used for defining a finite set of choices and are converted to
Avro `:enum`s. An example would be:

`(s/def ::color #{:red :green :blue})'
raw docstring

post-deserializeclj

(post-deserialize spec-k v)

Processes a deserailized value v from Avro.

For example, it converts bytes to a BigDecimal for an Avro :decimal, integers to Instants for :timestamp-millis and so on, according to the Avro specification.

Processes a deserailized value `v` from Avro.

For example, it converts bytes to a `BigDecimal` for an Avro `:decimal`,
integers to `Instants` for `:timestamp-millis` and so on, according to the
Avro specification.
raw docstring

post-deserialize*cljmultimethod

See post-deserialize.

NOTE: you shouldn't need to call this directly, but you can extend this multimethod to implement value post-deserialization for specs that aren't included here.

See `post-deserialize`.

NOTE: you shouldn't need to call this directly, but you can extend this
multimethod to implement value post-deserialization for specs that aren't
included here.
raw docstring

pre-serializeclj

(pre-serialize spec-k v)

Prepares a value v for encoding to Avro.

For example, it converts BigDecimals to bytes for Avro :decimals, :timestamp-millis to integers and so on, according to the Avro specification.

Prepares a value `v` for encoding to Avro.

For example, it converts `BigDecimal`s to bytes for Avro `:decimal`s,
`:timestamp-millis` to integers and so on, according to the Avro
specification.
raw docstring

pre-serialize*cljmultimethod

See pre-serialize.

NOTE: you shouldn't need to call this directly, but you can extend this multimethod to implement value pre-serialization for specs that aren't included here.

See `pre-serialize`.

NOTE: you shouldn't need to call this directly, but you can extend this
multimethod to implement value pre-serialization for specs that aren't
included here.
raw docstring

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

× close