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.

v0 state

Back to all declarations

ErrUserCallOnly

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: post must be a direct user call"

ErrReward

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: send exactly one coin of ugnot"

ErrRewardRange

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: reward is outside the allowed range"

ErrTitle

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: title must be 3 to 120 characters"

ErrDetails

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: details are too long"

ErrDone

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: done text is too long"

ErrCategory

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: unknown category"

ErrDeadline

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: deadline must be 1 hour to 90 days from now"

ErrNotFound

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task not found"

ErrNotOpen

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task is not open"

ErrOwnTask

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: you cannot take your own task"

ErrPastDeadline

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: deadline has passed"

ErrNotDoer

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: only the doer can do this"

ErrNotPoster

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: only the poster can do this"

ErrNotTaken

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task is not taken"

ErrNotInReview

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task is not in review"

ErrURL

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: work link must start with https:// and have no spaces"

ErrChangesUsed

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: changes were already asked once"

ErrNote

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: note must be 1 to 1000 characters"

ErrTooEarly

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: the review window has not ended"

ErrDoerHasTime

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: the doer still has time before the deadline"

ErrCannotCancel

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: this task can no longer be cancelled"

Denom

untyped string

Rules. They are constants so anyone can read them in the source.

Value

"ugnot"

MinReward

int64

// 1 GNOT

Value

1000000

MaxReward

int64

// 1 billion GNOT, a sanity cap

Value

1000000000000000

ReviewWindow

time.Duration

// poster's time to answer sent work

Value

<zero>

ChangesExtension

time.Duration

// minimum time a doer gets after changes are asked

Value

<zero>

MinDeadline

time.Duration

Rules. They are constants so anyone can read them in the source.

Value

<zero>

MaxDeadline

time.Duration

Rules. They are constants so anyone can read them in the source.

Value

<zero>

MinTitle

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(3 <untyped> bigint)

MaxTitle

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(120 <untyped> bigint)

MaxDetails

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(4000 <untyped> bigint)

MaxDone

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(1000 <untyped> bigint)

MaxURL

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(300 <untyped> bigint)

MaxNote

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(1000 <untyped> bigint)

MaxPage

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(50 <untyped> bigint)

Status

type

Status is where a task is in its life.

Value

v0.Status

StatusOpen

v0.Status

// reward locked, waiting for a doer

Value

<zero>

StatusTaken

v0.Status

// a doer is working on it

Value

<zero>

StatusInReview

v0.Status

// work sent, waiting for the poster

Value

<zero>

StatusPaid

v0.Status

// reward paid to the doer

Value

<zero>

StatusRefunded

v0.Status

// reward returned to the poster

Value

<zero>

Task

type

Task is one posted piece of work.

Value

v0.Task

tasks

v0.Tree

// id key -> \*Task, every task

Open
OID
015bd3…1fe7:6
tasks details

Inspect ref

openTasks

v0.Tree

// id key -> \*Task, only open tasks

Open
OID
015bd3…1fe7:8
openTasks details

Inspect ref

byPoster

v0.Tree

// address -> \*avl.Tree of id key -> \*Task

Open
OID
015bd3…1fe7:10
byPoster details

Inspect ref

byDoer

v0.Tree

// address -> \*avl.Tree of id key -> \*Task

Open
OID
015bd3…1fe7:12
byDoer details

Inspect ref

nextID

v0.ID

Value

<zero>

lockedTotal

int64

// rewards currently held by this realm

Value

0

paidTotal

int64

// rewards paid to doers

Value

0

webPath

string

// this realm's gnoweb path, e.g. "/r/thesithunyein/gild/v0"

Value

"/r/g1jw2yrfqnd4fp90qadw88pnjgpden4vgagjvpe6/gild/v0"

Post

func(title string, details string, done string, category string, deadline int64) int64

Post creates a task and locks the coins sent with the call as its reward. It must be called directly by a user (maketx call) with exactly one coin of Denom attached. deadline is a Unix time in seconds.

Open
OID
015bd3…1fe7:23
Post details

Inspect func

Take

func(id int64)

Take assigns an open task to the caller. The poster cannot take their own task, and nobody can take a task after its deadline.

Open
OID
015bd3…1fe7:24
Take details

Inspect func

Release

func(id int64)

Release gives a taken task back so someone else can take it. Only the doer can call it, and only before work is sent. Any change request is cleared, so the next doer starts fresh.

Open
OID
015bd3…1fe7:25
Release details

Inspect func

Submit

func(id int64, workURL string)

Submit sends a link to the finished work. Only the doer can call it, and only while the task is taken.

Open
OID
015bd3…1fe7:26
Submit details

Inspect func

Approve

func(id int64)

Approve pays the doer. Only the poster can call it, and only after work was sent.

Open
OID
015bd3…1fe7:27
Approve details

Inspect func

RequestChanges

func(id int64, note string)

RequestChanges sends the task back to the doer once. The doer gets at least ChangesExtension from now before the poster can take the reward back.

Open
OID
015bd3…1fe7:28
RequestChanges details

Inspect func

ClaimAfterSilence

func(id int64)

ClaimAfterSilence pays the doer when the poster has not answered within ReviewWindow of the work being sent.

Open
OID
015bd3…1fe7:29
ClaimAfterSilence details

Inspect func

Cancel

func(id int64)

Cancel returns the reward to the poster. It works while the task is open, or when a doer took it but sent no work before the deadline. It never works once work has been sent, so a poster cannot cancel to avoid paying.

Open
OID
015bd3…1fe7:30
Cancel details

Inspect func

Completed

func(addr .uverse.address) int

Completed returns how many tasks addr finished and was paid for on Gild. Other realms can call it to gate features by proven work.

Open
OID
015bd3…1fe7:31
Completed details

Inspect func

Earned

func(addr .uverse.address) int64

Earned returns the total paid to addr on Gild, in Denom.

Open
OID
015bd3…1fe7:32
Earned details

Inspect func

HasCompleted

func(addr .uverse.address, n int) bool

HasCompleted reports whether addr finished at least n tasks on Gild.

Open
OID
015bd3…1fe7:33
HasCompleted details

Inspect func

pay

func(t *v0.Task, rlm .uverse.realm, by string)

pay marks the task paid, records it, then sends the reward. State changes come before the transfer.

Open
OID
015bd3…1fe7:34
pay details

Inspect func

send

func(to .uverse.address, amount int64, rlm .uverse.realm)

send pays amount from this realm to addr. rlm must be the live realm handle.

Open
OID
015bd3…1fe7:35
send details

Inspect func

rewardFrom

func(sent chain.Coins) int64
Open
OID
015bd3…1fe7:36
rewardFrom details

Inspect func

idStr

func(id v0.ID) string

idStr is the public form of a task id, e.g. "12".

Open
OID
015bd3…1fe7:37
idStr details

Inspect func

index

func(tree *v0.Tree, addr .uverse.address, key string, t *v0.Task)
Open
OID
015bd3…1fe7:39
index details

Inspect func

unindex

func(tree *v0.Tree, addr .uverse.address, key string)
Open
OID
015bd3…1fe7:40
unindex details

Inspect func

isCategory

func(c string) bool
Open
OID
015bd3…1fe7:41
isCategory details

Inspect func

TaskJSON

func(id int64) string

TaskJSON returns one task as JSON, or "null" if it does not exist.

Open
OID
015bd3…1fe7:42
TaskJSON details

Inspect func

TasksJSON

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

TasksJSON lists tasks newest first. filter is "open" or "all".

Open
OID
015bd3…1fe7:44
TasksJSON details

Inspect func

PosterTasksJSON

func(addr .uverse.address, offset int, limit int) string

PosterTasksJSON lists tasks posted by addr, newest first.

Open
OID
015bd3…1fe7:45
PosterTasksJSON details

Inspect func

DoerTasksJSON

func(addr .uverse.address, offset int, limit int) string

DoerTasksJSON lists tasks taken by addr, newest first.

Open
OID
015bd3…1fe7:46
DoerTasksJSON details

Inspect func

StatsJSON

func() string

StatsJSON returns board totals.

Open
OID
015bd3…1fe7:47
StatsJSON details

Inspect func

ProfileJSON

func(addr .uverse.address) string

ProfileJSON returns the work record of addr.

Open
OID
015bd3…1fe7:48
ProfileJSON details

Inspect func

sub

func(tree *v0.Tree, addr .uverse.address) *v0.Tree
Open
OID
015bd3…1fe7:49
sub details

Inspect func

clampPage

func(offset int, limit int) (int, int)
Open
OID
015bd3…1fe7:50
clampPage details

Inspect func

pageJSON

func(tree *v0.Tree, offset int, limit int) string
Open
OID
015bd3…1fe7:51
pageJSON details

Inspect func

taskJSON

func(t *v0.Task) string
Open
OID
015bd3…1fe7:52
taskJSON details

Inspect func

jsonStr

func(s string) string

jsonStr returns s as a JSON string literal. It also escapes \<, > and & so the output is safe to place inside HTML.

Open
OID
015bd3…1fe7:54
jsonStr details

Inspect func

Render

func(path string) string

Render serves "" (open tasks), "task/\<id>" and "u/\<address>".

Open
OID
015bd3…1fe7:55
Render details

Inspect func

renderTask

func(t *v0.Task) string
Open
OID
015bd3…1fe7:57
renderTask details

Inspect func

renderProfile

func(addr .uverse.address) string
Open
OID
015bd3…1fe7:58
renderProfile details

Inspect func

mdText

func(s string) string

mdText escapes characters that would turn user text into markdown links, images, headings or HTML.

Open
OID
015bd3…1fe7:59
mdText details

Inspect func

gnot

func(u int64) string

gnot formats an amount in ugnot as GNOT, e.g. 1500000 -> "1.5 GNOT".

Open
OID
015bd3…1fe7:60
gnot details

Inspect func

trimSpace

func(s string) string
Open
OID
015bd3…1fe7:61
trimSpace details

Inspect func

checkText

func(s string, min int, max int, msg string)

checkText panics with msg unless s has between min and max characters and contains no control characters other than newline and tab.

Open
OID
015bd3…1fe7:63
checkText details

Inspect func

isWorkURL

func(s string) bool

isWorkURL accepts https links with no spaces or control characters.

Open
OID
015bd3…1fe7:64
isWorkURL details

Inspect func
ErrUserCallOnly : untyped string ="gild: post must be a direct user call"
ErrReward : untyped string ="gild: send exactly one coin of ugnot"
ErrRewardRange : untyped string ="gild: reward is outside the allowed range"
ErrTitle : untyped string ="gild: title must be 3 to 120 characters"
ErrDetails : untyped string ="gild: details are too long"
ErrDone : untyped string ="gild: done text is too long"
ErrCategory : untyped string ="gild: unknown category"
ErrDeadline : untyped string ="gild: deadline must be 1 hour to 90 days from now"
ErrNotFound : untyped string ="gild: task not found"
ErrNotOpen : untyped string ="gild: task is not open"
ErrOwnTask : untyped string ="gild: you cannot take your own task"
ErrPastDeadline : untyped string ="gild: deadline has passed"
ErrNotDoer : untyped string ="gild: only the doer can do this"
ErrNotPoster : untyped string ="gild: only the poster can do this"
ErrNotTaken : untyped string ="gild: task is not taken"
ErrNotInReview : untyped string ="gild: task is not in review"
ErrURL : untyped string ="gild: work link must start with https:// and have no spaces"
ErrChangesUsed : untyped string ="gild: changes were already asked once"
ErrNote : untyped string ="gild: note must be 1 to 1000 characters"
ErrTooEarly : untyped string ="gild: the review window has not ended"
ErrDoerHasTime : untyped string ="gild: the doer still has time before the deadline"
ErrCannotCancel : untyped string ="gild: this task can no longer be cancelled"
Denom : untyped string ="ugnot"
MinReward : int64 =1000000
MaxReward : int64 =1000000000000000
ReviewWindow : time.Duration =<zero>
ChangesExtension : time.Duration =<zero>
MinDeadline : time.Duration =<zero>
MaxDeadline : time.Duration =<zero>
MinTitle : untyped bigint =(3 <untyped> bigint)
MaxTitle : untyped bigint =(120 <untyped> bigint)
MaxDetails : untyped bigint =(4000 <untyped> bigint)
MaxDone : untyped bigint =(1000 <untyped> bigint)
MaxURL : untyped bigint =(300 <untyped> bigint)
MaxNote : untyped bigint =(1000 <untyped> bigint)
MaxPage : untyped bigint =(50 <untyped> bigint)
Status : type =v0.Status
StatusOpen : v0.Status =<zero>
StatusTaken : v0.Status =<zero>
StatusInReview : v0.Status =<zero>
StatusPaid : v0.Status =<zero>
StatusRefunded : v0.Status =<zero>
categories : []string (len=6) Inspect
Task : type =v0.Task
tasks : v0.Tree Inspect
openTasks : v0.Tree Inspect
byPoster : v0.Tree Inspect
byDoer : v0.Tree Inspect
nextID : v0.ID =<zero>
book : *v0.Book Inspect
lockedTotal : int64 =0
paidTotal : int64 =0
webPath : string ="/r/g1jw2yrfqnd4fp90qadw88pnjgpden4vgagjvpe6/gild/v0"
init.53 : func() Inspect
Post : func(title string, details string, done string, category string, deadline int64) int64 Inspect
Take : func(id int64) Inspect
Release : func(id int64) Inspect
Submit : func(id int64, workURL string) Inspect
Approve : func(id int64) Inspect
RequestChanges : func(id int64, note string) Inspect
ClaimAfterSilence : func(id int64) Inspect
Cancel : func(id int64) Inspect
Completed : func(addr .uverse.address) int Inspect
Earned : func(addr .uverse.address) int64 Inspect
HasCompleted : func(addr .uverse.address, n int) bool Inspect
pay : func(t *v0.Task, rlm .uverse.realm, by string) Inspect
send : func(to .uverse.address, amount int64, rlm .uverse.realm) Inspect
rewardFrom : func(sent chain.Coins) int64 Inspect
idStr : func(id v0.ID) string Inspect
mustGet : func(id int64) *v0.Task Inspect
index : func(tree *v0.Tree, addr .uverse.address, key string, t *v0.Task) Inspect
unindex : func(tree *v0.Tree, addr .uverse.address, key string) Inspect
isCategory : func(c string) bool Inspect
TaskJSON : func(id int64) string Inspect
TasksJSON : func(filter string, offset int, limit int) string Inspect
PosterTasksJSON : func(addr .uverse.address, offset int, limit int) string Inspect
DoerTasksJSON : func(addr .uverse.address, offset int, limit int) string Inspect
StatsJSON : func() string Inspect
ProfileJSON : func(addr .uverse.address) string Inspect
sub : func(tree *v0.Tree, addr .uverse.address) *v0.Tree Inspect
clampPage : func(offset int, limit int) (int, int) Inspect
pageJSON : func(tree *v0.Tree, offset int, limit int) string Inspect
taskJSON : func(t *v0.Task) string Inspect
unix : func(t time.Time) string Inspect
jsonStr : func(s string) string Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderTask : func(t *v0.Task) string Inspect
renderProfile : func(addr .uverse.address) string Inspect
mdText : func(s string) string Inspect
gnot : func(u int64) string Inspect
trimSpace : func(s string) string Inspect
checkText : func(s string, min int, max int, msg string) Inspect
isWorkURL : func(s string) bool Inspect