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.

v0 state

Back to all declarations

Trigger

type

Trigger 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 string

Value

"gno.land/r/"

maxTarget

untyped bigint

Value

(256 <untyped> bigint)

maxName

untyped bigint

Value

(64 <untyped> bigint)

maxFilterPairs

untyped bigint

Value

(8 <untyped> bigint)

maxBody

untyped bigint

Value

(255 <untyped> bigint)

maxPerTarget

untyped bigint

Value

(64 <untyped> bigint)

triggers

v0.Tree

// id → \*Trigger

Open
OID
02f446…a5ff:4
triggers details

Inspect ref

byTarget

v0.Tree

// target → \*avl.Tree of id → \*Trigger, verified triggers only

Open
OID
02f446…a5ff:6
byTarget details

Inspect ref

lastID

v0.ID

Value

<zero>

Declare

func(target string, event string, filter string, param string, title string, body string, link string) string

Declare stores a trigger and returns its id. The trigger is verified when its caller is the target realm itself.

Open
OID
02f446…a5ff:8
Declare details

Inspect func

Remove

func(id string)

Remove deletes a trigger. Only its declarer may remove it.

Open
OID
02f446…a5ff:10
Remove details

Inspect func

validate

func(target string, event string, filter string, param string, title string, body string, link string)
Open
OID
02f446…a5ff:11
validate details

Inspect func

sized

func(s string, lo int, hi int) bool
Open
OID
02f446…a5ff:12
sized details

Inspect func

validTarget

func(target string) bool

validTarget accepts a realm path whose segments each match the chain's Re\_name, so a target names a path where a realm can exist.

Open
OID
02f446…a5ff:13
validTarget details

Inspect func

isLowerAlnum

func(c uint8) bool
Open
OID
02f446…a5ff:14
isLowerAlnum details

Inspect func

validName

func(s string, lo int, hi int) bool

validName accepts identifier bytes only, so a name cannot carry spaces or symbols that imitate the verified mark in rendered output.

Open
OID
02f446…a5ff:15
validName details

Inspect func

validFilter

func(filter string) bool
Open
OID
02f446…a5ff:16
validFilter details

Inspect func

pageSize

untyped bigint

Value

(50 <untyped> bigint)

Render

func(path string) string

Render serves "" (the first page), "page/N", "trigger/\<id>" and "target/\<path>".

Open
OID
02f446…a5ff:18
Render details

Inspect func

renderPage

func(n int) string

renderPage lists the triggers newest first, pageSize to a page.

Open
OID
02f446…a5ff:20
renderPage details

Inspect func

renderTarget

func(target string, own *v0.Tree) string

renderTarget lists a realm's verified triggers, newest first. The cap on them keeps the page to one screen, so it is not paged.

Open
OID
02f446…a5ff:21
renderTarget details

Inspect func

writeLine

func(b *strings.Builder, tr *v0.Trigger)
Open
OID
02f446…a5ff:22
writeLine details

Inspect func

renderTrigger

func(tr *v0.Trigger) string
Open
OID
02f446…a5ff:23
renderTrigger details

Inspect func

selfPath

string

selfPath 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/alpha2/gnotif/v0"
Trigger : type =v0.Trigger
targetPrefix : untyped string ="gno.land/r/"
maxTarget : untyped bigint =(256 <untyped> bigint)
maxName : untyped bigint =(64 <untyped> bigint)
maxFilterPairs : untyped bigint =(8 <untyped> bigint)
maxBody : untyped bigint =(255 <untyped> bigint)
maxPerTarget : untyped bigint =(64 <untyped> bigint)
triggers : v0.Tree Inspect
byTarget : v0.Tree Inspect
lastID : v0.ID =<zero>
Declare : func(target string, event string, filter string, param string, title string, body string, link string) string Inspect
Remove : func(id string) Inspect
validate : func(target string, event string, filter string, param string, title string, body string, link string) Inspect
sized : func(s string, lo int, hi int) bool Inspect
validTarget : func(target string) bool Inspect
isLowerAlnum : func(c uint8) bool Inspect
validName : func(s string, lo int, hi int) bool Inspect
validFilter : func(filter string) bool Inspect
pageSize : untyped bigint =(50 <untyped> bigint)
Render : func(path string) string Inspect
renderPage : func(n int) string Inspect
renderTarget : func(target string, own *v0.Tree) string Inspect
writeLine : func(b *strings.Builder, tr *v0.Trigger) Inspect
renderTrigger : func(tr *v0.Trigger) string Inspect
selfPath : string ="/r/g1rzgxl6njyu4c2x89gxvaa9cswrt73rz8mlp7l6/alpha2/gnotif/v0"