Shares
Links to a port, a file or a folder that open on your other signed-in devices.
Cua.share(target, access, ttl_seconds, name) makes a link the cua daemon owns and serves, shares lists them, stop_share and stop_all_shares end them and check_share opens a link once as its owner. See Share a link to anything you run.
Share record#
One share.
Returned by Cua.share, Cua.shares.
| Field | Type | Default | Description |
|---|---|---|---|
id | String | Handle for Shares.stop (share-...). | |
url | String | The link. | |
name | Option<String> | Name for lists. | |
access | ShareAccess | Who may open it. | |
kind | String | port, space_port, file or dir. | |
target | String | What it serves (port 3000, space:dev:3000, a path). | |
owner | String | The account that made it. | |
created_at_unix / createdAtUnix | Option<i64> | When it was made (unix seconds). | |
expires_at_unix / expiresAtUnix | Option<i64> | When it ends (unix seconds); none: until stopped. | |
notices | Vec<String> | Limits of this link worth showing next to it (for example that browsers cannot open it yet). |
ShareAccess enum#
Who may open a share.
ShareAccess.PRIVATE
ShareAccess.TEAM
ShareAccess.PUBLIC| Variant | Description |
|---|---|
Private | Only the owner's cua.ai account, on any of the owner's devices. |
Team | Members of the owner's team. |
Public | Anyone with the link, until it expires or is stopped. |
ShareCheck record#
What opening a link once returned.
Returned by Cua.check_share.
| Field | Type | Default | Description |
|---|---|---|---|
ok | bool | 2xx. | |
status | u32 | HTTP status (0: the link could not be opened). | |
via | String | link (the real link, through the relay, as the owner) or local. | |
detail | String | A short human line. |