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
- 0edd31…1e14: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
- 0edd31…1e14:6
Declare details
Remove
func(id string)Remove deletes a trigger. Only its declarer may remove it.
- OID
- 0edd31…1e14:8
Remove details
validate
func(target string, event string, filter string, param string, title string, body string, link string)- OID
- 0edd31…1e14:9
validate details
sized
func(s string, lo int, hi int) bool- OID
- 0edd31…1e14: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
- 0edd31…1e14:11
validTarget details
isLowerAlnum
func(c uint8) bool- OID
- 0edd31…1e14: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
- 0edd31…1e14:13
validName details
validFilter
func(filter string) bool- OID
- 0edd31…1e14: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
- 0edd31…1e14:15
validLink details
pageSize
untyped bigintValue
(50 <untyped> bigint)
Render
func(path string) stringRender serves "" (the first page), "page/N" and "trigger/\<id>".
- OID
- 0edd31…1e14:16
Render details
renderPage
func(n int) stringrenderPage lists the triggers newest first, pageSize to a page.
- OID
- 0edd31…1e14:18
renderPage details
renderTrigger
func(tr *v0.Trigger) string- OID
- 0edd31…1e14: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/g13rqvks880v0hmlfepcj0kkudq0js38d3pc5k6a/gnotif/v0"