Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 state

Back to all declarations

selfPath

untyped string

selfPath is this realm's own page. A root-relative link resolves against the domain, not the realm, so every link back into it names it in full.

Value

"/r/nym-moultest123/x/daily/urlshort/v1"

entry

type

entry is the persisted record for a single alias.

Value

v1.entry

aliases

v0.Tree

aliases maps alias (string) -> \*entry, kept in an avl.Tree for deterministic iteration order in Render.

Open
OID
0b30e9…3acd:4
aliases details

Inspect ref

isAlphanumeric

func(s string) bool

isAlphanumeric reports whether s is non-empty and made only of \[0-9A-Za-z].

Open
OID
0b30e9…3acd:5
isAlphanumeric details

Inspect func

Shorten

func(alias string, url string, note string)

Shorten registers \`alias -> url\` owned by the caller. Rules: - alias must be non-empty and alphanumeric; - url must be non-empty; - if the alias is unclaimed, it is created owned by the caller; - if it is already claimed by the caller, the url/note are updated; - if it is claimed by someone else, the call aborts.

Open
OID
0b30e9…3acd:7
Shorten details

Inspect func

Remove

func(alias string)

Remove deletes an alias owned by the caller. Aborts if the alias does not exist or the caller is not the owner.

Open
OID
0b30e9…3acd:8
Remove details

Inspect func

Lookup

func(alias string) (string, bool)

Lookup returns the target url for an alias and whether it exists. It is a read-only helper and does NOT increment the click counter.

Open
OID
0b30e9…3acd:9
Lookup details

Inspect func

Render

func(path string) string

Render renders Markdown. The root path lists every alias; "/\<alias>" shows a single alias detail and bumps its click counter.

Open
OID
0b30e9…3acd:10
Render details

Inspect func

itoa

func(n int) string

itoa converts a non-negative int to its decimal string without importing strconv (kept minimal & deterministic).

Open
OID
0b30e9…3acd:12
itoa details

Inspect func

safeURL

func(u string) bool

safeURL reports whether u can be written into a markdown autolink unescaped.

Open
OID
0b30e9…3acd:13
safeURL details

Inspect func
selfPath : untyped string ="/r/nym-moultest123/x/daily/urlshort/v1"
entry : type =v1.entry
aliases : v0.Tree Inspect
isAlphanumeric : func(s string) bool Inspect
Shorten : func(alias string, url string, note string) Inspect
Remove : func(alias string) Inspect
Lookup : func(alias string) (string, bool) Inspect
Render : func(path string) string Inspect
renderIndex : func() string Inspect
itoa : func(n int) string Inspect
safeURL : func(u string) bool Inspect