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.
(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.
(params sf-value)
Get the params from a parametrizable structured field value.
Get the params from a parametrizable structured field value.
(parse-sf-bare-item input)
Parse a structured field bare item.
Parse a structured field bare item.
(parse-sf-boolean input)
Parse a string into a org.greenbytes.http.sfv.BooleanItem
.
Parse a string into a `org.greenbytes.http.sfv.BooleanItem`.
(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`.
(parse-sf-dictionary input)
Parse a string into a org.greenbytes.http.sfv.Dictionary
.
Parse a string into a `org.greenbytes.http.sfv.Dictionary`.
(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`.
(parse-sf-integer-or-decimal input)
Parse a structured field number (integer or decimal).
Parse a structured field number (integer or decimal).
(parse-sf-item input)
Parse a structured field item.
Parse a structured field item.
(parse-sf-item-or-inner-list input)
Parse a structured field item or inner list.
Parse a structured field item or inner list.
(parse-sf-key input)
Parse a structured field key.
Parse a structured field key.
(parse-sf-list input)
Parse a string into a org.greenbytes.http.sfv.OuterList
.
Parse a string into a `org.greenbytes.http.sfv.OuterList`.
(parse-sf-parameters input)
Parse a string into a org.greenbytes.http.sfv.Parameters
.
Parse a string into a `org.greenbytes.http.sfv.Parameters`.
(parse-sf-string input)
Parse a string into a org.greenbytes.http.sfv.StringItem
.
Parse a string into a `org.greenbytes.http.sfv.StringItem`.
(parse-sf-token input)
Parse a string into a org.greenbytes.http.sfv.TokenItem
.
Parse a string into a `org.greenbytes.http.sfv.TokenItem`.
(serialize sf-value)
Turn a structured field value into a string.
Turn a structured field value into a string.
(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]]
(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]]
(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]]
(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.
(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]]
(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]]
(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.
(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.
(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]]
(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]]
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 valuesDictionaries 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.
(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`.
(with-params sf-value params)
Add parameters to a parametrizable structured field value.
Add parameters to a parametrizable structured field value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close