Liking cljdoc? Tell your friends :D

multiformats.address

Multiaddr aims to make network addresses future-proof, composable, and efficient.

An Address behaves like a sequence of [protocol-key value] pairs which you can seq through. This isn't an associative structure on protocol keys since you can have duplicate pairs and the order of the (key, val) pairs matters (e.g, for cases like tunneling).

The binary form of an address entry consists of one to three values:

  • A varint encoding the numeric protocol code
  • An optional varint with the number of bytes in a variable-length value (e.g. a UTF-8 string)
  • The bytes encoding the protocol value, if any

See: https://github.com/multiformats/multiaddr

Multiaddr aims to make network addresses future-proof, composable, and
efficient.

An `Address` behaves like a sequence of `[protocol-key value]` pairs which
you can `seq` through. This isn't an associative structure on protocol keys
since you can have duplicate pairs and the order of the (key, val) pairs
matters (e.g, for cases like tunneling).

The binary form of an address entry consists of one to three values:
- A varint encoding the numeric protocol code
- An optional varint with the number of bytes in a variable-length value (e.g. a UTF-8 string)
- The bytes encoding the protocol value, if any

See: https://github.com/multiformats/multiaddr
raw docstring

address?clj/s

(address? x)

True if the value is a multiaddress object.

True if the value is a multiaddress object.
sourceraw docstring

createclj/s

(create)
(create entries)

Constructs a new multiaddr from a sequence of protocol/value pairs. Each entry should be a vector with a protocol keyword and a value; alternatively, protocols with no value may be specified as a simple keyword. The values should be either strings or appropriate types, such as numbers or IP addresses.

(create [[:ip4 "127.0.0.1"] [:tcp 80] :tls])
Constructs a new multiaddr from a sequence of protocol/value pairs. Each
entry should be a vector with a protocol keyword and a value; alternatively,
protocols with no value may be specified as a simple keyword. The values
should be either strings or appropriate types, such as numbers or IP
addresses.

    (create [[:ip4 "127.0.0.1"] [:tcp 80] :tls])
sourceraw docstring

decodeclj/s

(decode data)

Decode a multiaddr by reading data from a byte array.

Decode a multiaddr by reading data from a byte array.
sourceraw docstring

encodeclj/s

(encode addr)

Encode a multiaddr into a binary representation. Returns the byte array.

Encode a multiaddr into a binary representation. Returns the byte array.
sourceraw docstring

parseclj/s

(parse string)

Parse a string representation into a multiaddr.

(parse "/ip4/127.0.0.1/tcp/80/tls")

Parse a string representation into a multiaddr.

(parse "/ip4/127.0.0.1/tcp/80/tls")
sourceraw docstring

protocolsclj/s

Map from address protocol keywords to a map of information about it.

https://github.com/multiformats/multiaddr/blob/master/protocols.csv

Map from address protocol keywords to a map of information about it.

https://github.com/multiformats/multiaddr/blob/master/protocols.csv
sourceraw docstring

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

× close