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)
triggers
v0.Tree// id → \*Trigger
- OID
- 0113a8…433a:4
triggers 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. The trigger is verified when its caller is the target realm itself.
- OID
- 0113a8…433a:6
Declare details
Remove
func(id string)Remove deletes a trigger. Only its declarer may remove it.
- OID
- 0113a8…433a:8
Remove details
validate
func(target string, event string, filter string, param string, title string, body string, link string)- OID
- 0113a8…433a:9
validate details
sized
func(s string, lo int, hi int) bool- OID
- 0113a8…433a:10
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
- 0113a8…433a:11
validTarget details
isLowerAlnum
func(c uint8) bool- OID
- 0113a8…433a:12
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
- 0113a8…433a:13
validName details
validFilter
func(filter string) bool- OID
- 0113a8…433a:14
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
- 0113a8…433a:15
validLink details
pageSize
untyped bigintValue
(50 <untyped> bigint)
Render
func(path string) stringRender serves "" (the first page), "page/N" and "trigger/\<id>".
- OID
- 0113a8…433a:16
Render details
renderPage
func(n int) stringrenderPage lists the triggers newest first, pageSize to a page.
- OID
- 0113a8…433a:18
renderPage details
renderTrigger
func(tr *v0.Trigger) string- OID
- 0113a8…433a:19
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/g1rzgxl6njyu4c2x89gxvaa9cswrt73rz8mlp7l6/gnotif/v0"