Liking cljdoc? Tell your friends :D

org.clojars.johnnyjayjay.sfv

Wrapper namespace for the org.greenbytes.http.sfv package, with some additional Clojure utilities.

The terminology used is analogous to RFC 8941. To construct structured field values, see the sf-* functions. To parse structured field values, see the parse-sf-* functions. To turn structured field values into Clojure data structures and vice-versa, see sfv->clj and clj->sfv respectively.

Wrapper namespace for the `org.greenbytes.http.sfv` package, with some additional Clojure utilities.

The terminology used is analogous to [RFC 8941](https://www.rfc-editor.org/rfc/rfc8941).
To construct structured field values, see the `sf-*` functions.
To parse structured field values, see the `parse-sf-*` functions.
To turn structured field values into Clojure data structures and vice-versa, see [[sfv->clj]] and [[clj->sfv]] respectively.
raw docstring

clj->sfvclj

(clj->sfv form)

Turn a Clojure data structure into a structured field value.

This is the semantic inverse of sfv->clj. Refer to that function for an explanation of the expected structure.

Turn a Clojure data structure into a structured field value.

This is the semantic inverse of [[sfv->clj]].
Refer to that function for an explanation of the expected structure.
sourceraw docstring

paramsclj

(params sf-value)

Get the params from a parametrizable structured field value.

Get the params from a parametrizable structured field value.
sourceraw docstring

parse-sf-bare-itemclj

(parse-sf-bare-item input)

Parse a structured field bare item.

Parse a structured field bare item.
sourceraw docstring

parse-sf-booleanclj

(parse-sf-boolean input)

Parse a string into a org.greenbytes.http.sfv.BooleanItem.

Parse a string into a `org.greenbytes.http.sfv.BooleanItem`.
sourceraw docstring

parse-sf-byte-sequenceclj

(parse-sf-byte-sequence input)

Parse a string into a org.greenbytes.http.sfv.ByteSequenceItem.

Parse a string into a `org.greenbytes.http.sfv.ByteSequenceItem`.
sourceraw docstring

parse-sf-dictionaryclj

(parse-sf-dictionary input)

Parse a string into a org.greenbytes.http.sfv.Dictionary.

Parse a string into a `org.greenbytes.http.sfv.Dictionary`.
sourceraw docstring

parse-sf-inner-listclj

(parse-sf-inner-list input)

Parse a string into a org.greenbytes.http.sfv.InnerList.

Parse a string into a `org.greenbytes.http.sfv.InnerList`.
sourceraw docstring

parse-sf-integer-or-decimalclj

(parse-sf-integer-or-decimal input)

Parse a structured field number (integer or decimal).

Parse a structured field number (integer or decimal).
sourceraw docstring

parse-sf-itemclj

(parse-sf-item input)

Parse a structured field item.

Parse a structured field item.
sourceraw docstring

parse-sf-item-or-inner-listclj

(parse-sf-item-or-inner-list input)

Parse a structured field item or inner list.

Parse a structured field item or inner list.
sourceraw docstring

parse-sf-keyclj

(parse-sf-key input)

Parse a structured field key.

Parse a structured field key.
sourceraw docstring

parse-sf-listclj

(parse-sf-list input)

Parse a string into a org.greenbytes.http.sfv.OuterList.

Parse a string into a `org.greenbytes.http.sfv.OuterList`.
sourceraw docstring

parse-sf-parametersclj

(parse-sf-parameters input)

Parse a string into a org.greenbytes.http.sfv.Parameters.

Parse a string into a `org.greenbytes.http.sfv.Parameters`.
sourceraw docstring

parse-sf-stringclj

(parse-sf-string input)

Parse a string into a org.greenbytes.http.sfv.StringItem.

Parse a string into a `org.greenbytes.http.sfv.StringItem`.
sourceraw docstring

parse-sf-tokenclj

(parse-sf-token input)

Parse a string into a org.greenbytes.http.sfv.TokenItem.

Parse a string into a `org.greenbytes.http.sfv.TokenItem`.
sourceraw docstring

serializeclj

(serialize sf-value)

Turn a structured field value into a string.

Turn a structured field value into a string.
sourceraw docstring

sf-booleanclj

(sf-boolean value)
(sf-boolean params value)

Construct a org.greenbytes.http.sfv.BooleanItem object.

value is a Boolean. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.BooleanItem object.

`value` is a Boolean.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-boolean-readerclj

(sf-boolean-reader lit)
source

sf-byte-sequenceclj

(sf-byte-sequence value)
(sf-byte-sequence params value)

Construct a org.greenbytes.http.sfv.ByteSequenceItem object.

value is a bytes. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.ByteSequenceItem object.

`value` is a bytes.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-decimalclj

(sf-decimal value)
(sf-decimal params value)

Construct a org.greenbytes.http.sfv.DecimalItem object.

value is a BigDecimal. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.DecimalItem object.

`value` is a BigDecimal.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-decimal-readerclj

(sf-decimal-reader lit)
source

sf-dictionaryclj

(sf-dictionary value)

Construct a org.greenbytes.http.sfv.Dictionary object.

value is a Map.

Construct a org.greenbytes.http.sfv.Dictionary object.

`value` is a Map.
sourceraw docstring

sf-inner-listclj

(sf-inner-list value)
(sf-inner-list params value)

Construct a org.greenbytes.http.sfv.InnerList object.

value is a List. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.InnerList object.

`value` is a List.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-inner-list-readerclj

(sf-inner-list-reader lit)
source

sf-integerclj

(sf-integer value)
(sf-integer params value)

Construct a org.greenbytes.http.sfv.IntegerItem object.

value is a Long. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.IntegerItem object.

`value` is a Long.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-integer-readerclj

(sf-integer-reader lit)
source

sf-item-constructorsclj

source

sf-item-typesclj

source

sf-listclj

(sf-list value)

Construct a org.greenbytes.http.sfv.OuterList object.

value is a List.

Construct a org.greenbytes.http.sfv.OuterList object.

`value` is a List.
sourceraw docstring

sf-parametersclj

(sf-parameters value)

Construct a org.greenbytes.http.sfv.Parameters object.

value is a Map.

Construct a org.greenbytes.http.sfv.Parameters object.

`value` is a Map.
sourceraw docstring

sf-stringclj

(sf-string value)
(sf-string params value)

Construct a org.greenbytes.http.sfv.StringItem object.

value is a String. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.StringItem object.

`value` is a String.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-string-readerclj

(sf-string-reader lit)
source

sf-tokenclj

(sf-token value)
(sf-token params value)

Construct a org.greenbytes.http.sfv.TokenItem object.

value is a String. Values of this SF type are parametrizable: The optional params parameter is a org.greenbytes.http.sfv.Parameters object. See also: sf-parameters, with-params

Construct a org.greenbytes.http.sfv.TokenItem object.

`value` is a String.
Values of this SF type are parametrizable: The optional `params` parameter is a org.greenbytes.http.sfv.Parameters object. See also: [[sf-parameters]], [[with-params]]
sourceraw docstring

sf-token-readerclj

(sf-token-reader lit)
source

sfv->cljcljmultimethod

Turn a structured field value into Clojure data.

Parametrizable types (i.e., inner lists and items) get turned into a map like this:

{:type ... :value ... :params {...}}

where:

  • :type is one of the keys in sf-item-constructors (:sf/integer, sf/string, ...)
  • :value is the encapsulated value for items or a vector of the values for inner lists
  • :params is a map of string -> parameter values

Dictionaries get turned into [[ordered-map]]s. Lists (outer lists) get turned into vectors.

For composite types (lists, parameters, dictionaries), their values are also coerced via sfv->clj. Keys in parameter maps and dictionaries are turned into keywords.

Turn a structured field value into Clojure data.

Parametrizable types (i.e., inner lists and items) get turned into a map like this:

{:type ...
 :value ...
 :params {...}}

where:
- `:type` is one of the keys in [[sf-item-constructors]] (`:sf/integer`, `sf/string`, ...)
- `:value` is the encapsulated [[value]] for items or a vector of the values for inner lists
- `:params` is a map of string -> parameter values

Dictionaries get turned into [[ordered-map]]s.
Lists (outer lists) get turned into vectors.

For composite types (lists, parameters, dictionaries), their values are also coerced via [[sfv->clj]].
Keys in parameter maps and dictionaries are turned into keywords.
sourceraw docstring

valueclj

(value sf-value)

Get the encapsulated value from a structured field value.

E.g., for an IntegerItem, this will return a long.

Get the encapsulated value from a structured field value.

E.g., for an `IntegerItem`, this will return a `long`.
sourceraw docstring

with-paramsclj

(with-params sf-value params)

Add parameters to a parametrizable structured field value.

Add parameters to a parametrizable structured field value.
sourceraw docstring

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

× close