Search Apps Documentation Source Content File Folder Download Copy Actions Download

boards.gno

0.67 Kb · 30 lines
 1package boards
 2
 3import (
 4	"chain/runtime"
 5	"regexp"
 6
 7	"gno.land/p/moul/txlink"
 8	"gno.land/p/nt/avl/v0"
 9)
10
11//----------------------------------------
12// Realm (package) state
13
14var (
15	gRealmLink      txlink.Realm
16	gBoards         avl.Tree    // id -> *Board
17	gBoardsCtr      int         // increments Board.id
18	gBoardsByName   avl.Tree    // name -> *Board
19	gDefaultAnonFee = 100000000 // minimum fee required if anonymous
20)
21
22//----------------------------------------
23// Constants
24
25var reName = regexp.MustCompile(`^[a-z]+[_a-z0-9]{2,29}$`)
26
27func init() {
28	// Keep track of the realm package path to make it available on render
29	gRealmLink = txlink.Realm(runtime.CurrentRealm().PkgPath())
30}