Trigger
typeTrigger is one declared notification rule. Filter holds comma-separated key=value pairs; Title, Body and Link are templates where {key} stands for the value of the event's attribute key.
Value
v0.Trigger
targetPrefix
untyped stringValue
"gno.land/r/"
maxTarget
untyped bigintValue
(256 <untyped> bigint)
maxName
untyped bigintValue
(64 <untyped> bigint)
maxFilterPairs
untyped bigintValue
(8 <untyped> bigint)
maxBody
untyped bigintValue
(255 <untyped> bigint)
maxLink
untyped bigintValue
(256 <untyped> bigint)
maxPerTarget
untyped bigintValue
(64 <untyped> bigint)
triggers
v0.Tree// id → \*Trigger
- OID
- 033268…6d48:4
triggers details
byTarget
v0.Tree// target → \*avl.Tree of id → \*Trigger, verified triggers only
- OID
- 033268…6d48:6
byTarget details
lastID
v0.IDValue
<zero>
Declare
func(target string, event string, filter string, param string, title string, body string, link string) stringDeclare stores a trigger and returns its id. Only the target realm itself may declare a trigger for it.
- OID
- 033268…6d48:8
Declare details
Remove
func(id string)Remove deletes a trigger. Only its declarer may remove it.
- OID
- 033268…6d48:10
Remove details
validate
func(target string, event string, filter string, param string, title string, body string, link string)- OID
- 033268…6d48:11
validate details
sized
func(s string, lo int, hi int) bool- OID
- 033268…6d48:12
sized details
validTarget
func(target string) boolvalidTarget accepts a realm path whose segments each match the chain's Re\_name, so a target names a path where a realm can exist.
- OID
- 033268…6d48:13
validTarget details
isLowerAlnum
func(c uint8) bool- OID
- 033268…6d48:14
isLowerAlnum details
validName
func(s string, lo int, hi int) boolvalidName accepts identifier bytes only, so a name cannot carry spaces or symbols that imitate the verified mark in rendered output.
- OID
- 033268…6d48:15
validName details
validFilter
func(filter string) bool- OID
- 033268…6d48:16
validFilter details
validLink
func(link string) boolvalidLink accepts only a path, so a click always stays on the dapp's origin. "//host" starts with a slash yet resolves to another host. A URL parser drops tab, LF and CR and reads a backslash as a slash, so "/\\t/host" and "/\\host" would do the same; control bytes and backslashes are refused.
- OID
- 033268…6d48:17
validLink details
pageSize
untyped bigintValue
(50 <untyped> bigint)
Render
func(path string) stringRender serves "" (the first page), "page/N", "trigger/\<id>" and "target/\<path>".
- OID
- 033268…6d48:18
Render details
renderPage
func(n int) stringrenderPage lists the triggers newest first, pageSize to a page.
- OID
- 033268…6d48:20
renderPage details
renderTarget
func(target string, own *v0.Tree) stringrenderTarget lists a realm's verified triggers, newest first. The cap on them keeps the page to one screen, so it is not paged.
- OID
- 033268…6d48:21
renderTarget details
writeLine
func(b *strings.Builder, tr *v0.Trigger)- OID
- 033268…6d48:22
writeLine details
renderTrigger
func(tr *v0.Trigger) string- OID
- 033268…6d48:23
renderTrigger details
selfPath
stringselfPath is this realm's path on gnoweb. It is read at package init, where the realm itself is current; Render is not crossing, so reading it there would give the caller's path. It only builds links.
Value
"/r/nym-gfanton001/gnotif/v0"