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

triedemo/v0 package

Overview

Package triedemo is a small gnoweb demo of the prefix tree provided by the p/moul/x/daily/trie(/p/moul/x/daily/trie/v0) library: type a prefix in the URL and it lists every dictionary word that completes it.

It contains no trie logic of its own — the tree, the ordering and the limit all come from the library. The dictionary is a fixed, sorted word list so the realm has no mutable state and Render is fully deterministic.

Function

Render

func Render(path string) string

Render renders the autocomplete for gnoweb.

Example
1Render("")          / Render("/") -> the whole dictionary + usage
2Render("/<prefix>")               -> every word completing <prefix>

Param

Command

gnokey query vm/qeval -remote "http://127.0.0.1:26657" -data "gno.land/r/moul/x/daily/triedemo/v0.Render()"

Result