UrbitEx.Utils (UrbitEx v0.6.4) View Source
Utils module with some useful functions, such as a tokenizer for graph store, regex for urls and @ps, etc.
Link to this section Summary
Functions
Abbreviates comet and moon names following Landscape practice. Takes a string. Returns a string.
Adds tilde to an Urbit ship name if it lacks one. Takes a string. Returns a string.
Eyre endpoints which return a boolean are rather weird. Instead of returning true or false,
they return a 200 with null body if true, or a 500 if false.
See API.Graph.exists?
or API.Settings.has_bucket?
and others.
Produces an Urbit permalink as used by Landscape. Takes a group Resource struct, a channel Resource struct, and an index string. Returns an Urbit web+urbitgraph permalink.
Breaks an integer into a string resembling the hoon @ud type (long integer with a period every three digits, e.g. "170.123.456") Takes an integer, returns a string.
Checks whether the passed ship name belongs to a comet.
Takes a string, returns :ok
if not a comet, :gtfo
if a comet.
Produces a reference map as used by graph store from a permalink string. Takes a permalink string. Returns a reference map.
Removes tilde from an Urbit ship name if it has one. Takes a string. Returns a string.
Returns the ship type given a ship name. Takes a string, returns an atom with the ship class.
Takes a long string and breaks it up into tokens to be stored into graph-store.
Graph-store tokens can be text
, url
, mention
, reference
or code
.
Returns a list of token maps to pass to any graph-store post function.
Validates that a string is a valid Urbit shipname. It ignores tildes and other punctuation. Takes a string, returns a clean shipname if valid, false if invalid.
Link to this section Functions
Abbreviates comet and moon names following Landscape practice. Takes a string. Returns a string.
Adds tilde to an Urbit ship name if it lacks one. Takes a string. Returns a string.
Eyre endpoints which return a boolean are rather weird. Instead of returning true or false,
they return a 200 with null body if true, or a 500 if false.
See API.Graph.exists?
or API.Settings.has_bucket?
and others.
Produces an Urbit permalink as used by Landscape. Takes a group Resource struct, a channel Resource struct, and an index string. Returns an Urbit web+urbitgraph permalink.
Breaks an integer into a string resembling the hoon @ud type (long integer with a period every three digits, e.g. "170.123.456") Takes an integer, returns a string.
Checks whether the passed ship name belongs to a comet.
Takes a string, returns :ok
if not a comet, :gtfo
if a comet.
Produces a reference map as used by graph store from a permalink string. Takes a permalink string. Returns a reference map.
Removes tilde from an Urbit ship name if it has one. Takes a string. Returns a string.
Returns the ship type given a ship name. Takes a string, returns an atom with the ship class.
Takes a long string and breaks it up into tokens to be stored into graph-store.
Graph-store tokens can be text
, url
, mention
, reference
or code
.
Returns a list of token maps to pass to any graph-store post function.
Validates that a string is a valid Urbit shipname. It ignores tildes and other punctuation. Takes a string, returns a clean shipname if valid, false if invalid.