boards.gno

0.66 Kb ยท 30 lines
 1package boards
 2
 3import (
 4	"regexp"
 5	"std"
 6
 7	"gno.land/p/demo/avl"
 8	"gno.land/p/moul/txlink"
 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(std.CurrentRealm().PkgPath())
30}