IrohEx.Native (iroh_ex v0.0.14)
Summary
Functions
Get counter value.
Create or increment a counter. Returns the new value.
Create a new automerge document, returns doc_id.
Delete a document from memory.
Fork an existing document (create a copy with same history).
Generate a sync message to send to a peer. Returns :not_found if no sync is needed.
Delete a value from a list at index.
List all document IDs.
Get a value from a list at index. Returns :not_found if index doesn't exist.
Insert a value into a list at index.
Get list length.
Push a value to the end of a list.
Load a document from saved binary data.
Delete a key from a map.
Get a value from a map at the given path. Returns :not_found if key doesn't exist.
Get all keys from a map.
Put a value in a map at the given path. Path is a list of keys like ["users", "alice", "name"].
Put an object (map, list, or text) at path, returns the object ID. obj_type must be "map", "list", or "text".
Merge another document (as binary) into this one.
Receive and apply a sync message from a peer.
Save document to binary format.
Sync document via gossip (broadcast full document to all peers).
Create a text object at path with optional initial text. Returns the text object ID.
Delete text at position.
Get full text content.
Insert text at position.
Get document as JSON string for debugging/inspection.
Add binary data as a blob, returns the hash as hex string.
Get a blob by hash, returns the binary data.
List all blob hashes in the store.
Create a new document, returns namespace_id.
Create a new author for documents, returns author_id.
Get an entry from a document - returns content hash.
Get an entry value directly from a document.
List all documents.
Set an entry in a document.
Subscribe to a gossip topic with DHT-based auto-discovery. This allows nodes to find each other without exchanging tickets.
Functions
Get counter value.
@spec automerge_counter_increment( reference(), binary(), [binary()], binary(), integer() ) :: integer()
Create or increment a counter. Returns the new value.
Create a new automerge document, returns doc_id.
Delete a document from memory.
Fork an existing document (create a copy with same history).
Generate a sync message to send to a peer. Returns :not_found if no sync is needed.
@spec automerge_list_delete(reference(), binary(), [binary()], non_neg_integer()) :: :ok
Delete a value from a list at index.
List all document IDs.
@spec automerge_list_get(reference(), binary(), [binary()], non_neg_integer()) :: term()
Get a value from a list at index. Returns :not_found if index doesn't exist.
@spec automerge_list_insert( reference(), binary(), [binary()], non_neg_integer(), term() ) :: :ok
Insert a value into a list at index.
@spec automerge_list_length(reference(), binary(), [binary()]) :: non_neg_integer()
Get list length.
Push a value to the end of a list.
Load a document from saved binary data.
Delete a key from a map.
Get a value from a map at the given path. Returns :not_found if key doesn't exist.
Get all keys from a map.
Put a value in a map at the given path. Path is a list of keys like ["users", "alice", "name"].
Put an object (map, list, or text) at path, returns the object ID. obj_type must be "map", "list", or "text".
Merge another document (as binary) into this one.
Receive and apply a sync message from a peer.
Save document to binary format.
Sync document via gossip (broadcast full document to all peers).
Create a text object at path with optional initial text. Returns the text object ID.
@spec automerge_text_delete( reference(), binary(), [binary()], non_neg_integer(), non_neg_integer() ) :: :ok
Delete text at position.
Get full text content.
@spec automerge_text_insert( reference(), binary(), [binary()], non_neg_integer(), binary() ) :: :ok
Insert text at position.
Get document as JSON string for debugging/inspection.
Add binary data as a blob, returns the hash as hex string.
Get a blob by hash, returns the binary data.
List all blob hashes in the store.
Create a new document, returns namespace_id.
Create a new author for documents, returns author_id.
@spec docs_get_entry(reference(), binary(), binary(), binary()) :: {:ok, binary()} | {:error, term()}
Get an entry from a document - returns content hash.
@spec docs_get_entry_value(reference(), binary(), binary(), binary()) :: {:ok, binary()} | {:error, term()}
Get an entry value directly from a document.
List all documents.
@spec docs_set_entry(reference(), binary(), binary(), binary(), binary()) :: {:ok, binary()} | {:error, term()}
Set an entry in a document.
@spec subscribe_with_auto_discovery(reference(), binary(), binary() | nil) :: {:ok, reference()} | {:error, term()}
Subscribe to a gossip topic with DHT-based auto-discovery. This allows nodes to find each other without exchanging tickets.
Parameters
node- The node referencetopic_name- The topic name to subscribe tosecret_seed- Optional secret seed for key derivation (nil for random)
Returns
{:ok, node_ref}on success{:error, term()}on failure