Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

board state

Back to all declarations

SideBuy

untyped string

Value

"buy"

SideSell

untyped string

Value

"sell"

SideSwap

untyped string

Value

"swap"

MaxGiveLen

untyped bigint

Value

(80 <untyped> bigint)

MaxWantLen

untyped bigint

Value

(80 <untyped> bigint)

MaxNoteLen

untyped bigint

Value

(280 <untyped> bigint)

DefaultDays

untyped bigint

Value

(7 <untyped> bigint)

MaxDays

untyped bigint

Value

(30 <untyped> bigint)

MaxActivePerOwner

untyped bigint

Value

(10 <untyped> bigint)

day

untyped bigint

Value

(86400 <untyped> bigint)

listing

type

Value

board.listing

listings

v0.Tree

// padded id -> \*listing

Open
OID
0c7942…a2b8:4
listings details

Inspect ref

byOwner

v0.Tree

// address -> \[]uint64 listing ids, oldest first

Open
OID
0c7942…a2b8:6
byOwner details

Inspect ref

lastID

uint64

Value

0

Post

func(side string, give string, want string, note string, days int) uint64

Post publishes a listing and returns its id. side is buy, sell or swap; give and want are short phrases such as "50,000 GNOT"; note is optional. days is how long the listing stays up: 0 means 7, the most is 30.

Open
OID
0c7942…a2b8:8
Post details

Inspect func

Close

func(id uint64)

Close takes a listing down. Only its owner can close it.

Open
OID
0c7942…a2b8:10
Close details

Inspect func

activeCount

func(owner .uverse.address, now int64) int

activeCount counts the owner's open listings. Listings older than MaxDays cannot be open, so the walk stops there.

Open
OID
0c7942…a2b8:11
activeCount details

Inspect func

cleanText

func(field string, s string, max int, required bool) string

cleanText trims s and rejects text that is too long or carries control, bidi or zero-width characters.

Open
OID
0c7942…a2b8:12
cleanText details

Inspect func

mustListing

func(id uint64) *board.listing
Open
OID
0c7942…a2b8:15
mustListing details

Inspect func

listingKey

func(id uint64) string
Open
OID
0c7942…a2b8:16
listingKey details

Inspect func

jsonString

func(s string) string

jsonString quotes s as a JSON string. Everything outside printable ASCII is written as a \\u escape, so the output is plain ASCII.

Open
OID
0c7942…a2b8:17
jsonString details

Inspect func

writeU16

func(b *strings.Builder, r int32)
Open
OID
0c7942…a2b8:19
writeU16 details

Inspect func

jsonObject

func(pairs []string) string

jsonObject joins already-encoded key/value pairs.

Open
OID
0c7942…a2b8:23
jsonObject details

Inspect func

jsonArray

func(items []string) string
Open
OID
0c7942…a2b8:24
jsonArray details

Inspect func

maxPage

untyped bigint

Value

(50 <untyped> bigint)

ListingJSON

func(id uint64) string

ListingJSON returns one listing, or null.

Open
OID
0c7942…a2b8:25
ListingJSON details

Inspect func

OpenJSON

func(side string, offset int, limit int) string

OpenJSON lists open listings, newest first. side filters by buy, sell or swap; "" means all.

Open
OID
0c7942…a2b8:27
OpenJSON details

Inspect func

ListingsOfJSON

func(owner string, offset int, limit int) string

ListingsOfJSON lists every listing of one owner, newest first.

Open
OID
0c7942…a2b8:28
ListingsOfJSON details

Inspect func

page

func(offset int, limit int) (int, int)
Open
OID
0c7942…a2b8:29
page details

Inspect func

Render

func(path string) string

Render shows open listings on gnoweb, and one listing at listing/\<id>.

Open
OID
0c7942…a2b8:30
Render details

Inspect func

renderListing

func(l *board.listing, now int64) string
Open
OID
0c7942…a2b8:31
renderListing details

Inspect func

sideLabel

func(side string) string
Open
OID
0c7942…a2b8:32
sideLabel details

Inspect func

date

func(unix int64) string

date writes unix seconds as a UTC calendar date.

Open
OID
0c7942…a2b8:33
date details

Inspect func
SideBuy : untyped string ="buy"
SideSell : untyped string ="sell"
SideSwap : untyped string ="swap"
MaxGiveLen : untyped bigint =(80 <untyped> bigint)
MaxWantLen : untyped bigint =(80 <untyped> bigint)
MaxNoteLen : untyped bigint =(280 <untyped> bigint)
DefaultDays : untyped bigint =(7 <untyped> bigint)
MaxDays : untyped bigint =(30 <untyped> bigint)
MaxActivePerOwner : untyped bigint =(10 <untyped> bigint)
day : untyped bigint =(86400 <untyped> bigint)
listing : type =board.listing
listings : v0.Tree Inspect
byOwner : v0.Tree Inspect
lastID : uint64 =0
Post : func(side string, give string, want string, note string, days int) uint64 Inspect
Close : func(id uint64) Inspect
activeCount : func(owner .uverse.address, now int64) int Inspect
cleanText : func(field string, s string, max int, required bool) string Inspect
callerOf : func() .uverse.address Inspect
refuseCoins : func() Inspect
mustListing : func(id uint64) *board.listing Inspect
listingKey : func(id uint64) string Inspect
jsonString : func(s string) string Inspect
writeU16 : func(b *strings.Builder, r int32) Inspect
jsonUint : func(v uint64) string Inspect
jsonInt : func(v int64) string Inspect
jsonBool : func(v bool) string Inspect
jsonObject : func(pairs []string) string Inspect
jsonArray : func(items []string) string Inspect
maxPage : untyped bigint =(50 <untyped> bigint)
ListingJSON : func(id uint64) string Inspect
OpenJSON : func(side string, offset int, limit int) string Inspect
ListingsOfJSON : func(owner string, offset int, limit int) string Inspect
page : func(offset int, limit int) (int, int) Inspect
Render : func(path string) string Inspect
renderListing : func(l *board.listing, now int64) string Inspect
sideLabel : func(side string) string Inspect
date : func(unix int64) string Inspect