ErrFormNotFound
*errors.errorString- OID
- 058e11…40df:4
ErrFormNotFound details
ErrBadSlug
*errors.errorString- OID
- 058e11…40df:7
ErrBadSlug details
ErrSlugTaken
*errors.errorString- OID
- 058e11…40df:10
ErrSlugTaken details
ErrFormClosed
*errors.errorString- OID
- 058e11…40df:13
ErrFormClosed details
ErrFormOpen
*errors.errorString- OID
- 058e11…40df:16
ErrFormOpen details
ErrNotOwner
*errors.errorString- OID
- 058e11…40df:19
ErrNotOwner details
ErrNoFields
*errors.errorString- OID
- 058e11…40df:22
ErrNoFields details
ErrTooManyFields
*errors.errorString- OID
- 058e11…40df:25
ErrTooManyFields details
ErrFieldSpecMismatch
*errors.errorString- OID
- 058e11…40df:28
ErrFieldSpecMismatch details
ErrBadFieldKind
*errors.errorString- OID
- 058e11…40df:31
ErrBadFieldKind details
ErrSelectNoOptions
*errors.errorString- OID
- 058e11…40df:34
ErrSelectNoOptions details
ErrEmptyLabel
*errors.errorString- OID
- 058e11…40df:37
ErrEmptyLabel details
ErrPipeInField
*errors.errorString- OID
- 058e11…40df:40
ErrPipeInField details
ErrEmptyTitle
*errors.errorString- OID
- 058e11…40df:43
ErrEmptyTitle details
ErrTitleTooLong
*errors.errorString- OID
- 058e11…40df:46
ErrTitleTooLong details
ErrDescriptionTooLong
*errors.errorString- OID
- 058e11…40df:49
ErrDescriptionTooLong details
ErrBadDeadline
*errors.errorString- OID
- 058e11…40df:52
ErrBadDeadline details
ErrDeadlinePassed
*errors.errorString- OID
- 058e11…40df:55
ErrDeadlinePassed details
ErrAlreadyResponded
*errors.errorString- OID
- 058e11…40df:58
ErrAlreadyResponded details
ErrNoResponse
*errors.errorString- OID
- 058e11…40df:61
ErrNoResponse details
ErrRequired
*errors.errorString- OID
- 058e11…40df:64
ErrRequired details
ErrNotANumber
*errors.errorString- OID
- 058e11…40df:67
ErrNotANumber details
ErrNotAnOption
*errors.errorString- OID
- 058e11…40df:70
ErrNotAnOption details
ErrAnswerTooLong
*errors.errorString- OID
- 058e11…40df:73
ErrAnswerTooLong details
ErrTooManyAnswers
*errors.errorString- OID
- 058e11…40df:76
ErrTooManyAnswers details
ErrNotUserCall
*errors.errorString- OID
- 058e11…40df:79
ErrNotUserCall details
forms
*v0.Tree// slug -> \*Form
- OID
- 058e11…40df:82
forms details
nextRespID
v0.IDValue
<zero>
slugRe
*regexp.Regexp- OID
- 058e11…40df:86
slugRe details
Create
func(slug string, title string, description string, labels string, kinds string, required string, options string, onePerAddr bool, deadline int64) stringCreate publishes a new form under slug, which becomes its ID and its URL segment (/r/\<ns>/forms:\<slug>). Slugs are unique per realm. Fields are described by four parallel, pipe-separated strings so the call stays usable from gnokey and gnoweb without structured arguments: labels: "Name|Why gno.land?|Server type" kinds: "text|textarea|select" required: "1|1|0" options: "||cloud,on-prem,data-center" (comma-separated; only select uses it) deadline is a chain height after which the form stops accepting responses, or 0 for none. onePerAddr limits each address to a single response.
- OID
- 058e11…40df:148
Create details
CreateForm
func(slug string, title string, description string, l1 string, k1 string, r1 string, o1 string, l2 string, k2 string, r2 string, o2 string, l3 string, k3 string, r3 string, o3 string, l4 string, k4 string, r4 string, o4 string, l5 string, k5 string, r5 string, o5 string, l6 string, k6 string, r6 string, o6 string, l7 string, k7 string, r7 string, o7 string, l8 string, k8 string, r8 string, o8 string, onePerAddr string, deadline string) stringCreateForm is Create for the browser: the index page renders it as a gnoweb form, one row per field, so nothing has to be typed into the wallet. Every parameter is a string because gnoweb submits "" for an empty or unchecked input, and "" is not a bool or an int64 as far as the VM is concerned. Checkboxes send "1" when ticked. Blank rows are skipped; a row with an empty kind is text. deadline "" means none.
- OID
- 058e11…40df:150
CreateForm details
boolFlag
func(s string) stringboolFlag normalises what a checkbox or a human might send to "1" or "0".
- OID
- 058e11…40df:151
boolFlag details
create
func(slug string, title string, description string, labels string, kinds string, required string, options string, onePerAddr bool, deadline int64) string- OID
- 058e11…40df:152
create details
Close
func(id string)Close stops a form from accepting responses. Owner only.
- OID
- 058e11…40df:153
Close details
Reopen
func(id string)Reopen lets a closed form accept responses again. Owner only. A form whose deadline has passed stays closed regardless.
- OID
- 058e11…40df:154
Reopen details
TransferOwnership
func(id string, to .uverse.address)TransferOwnership hands a form to another address. Owner only.
- OID
- 058e11…40df:155
TransferOwnership details
GetForm
func(id string) (*test2.Form, bool)GetForm returns a form by ID.
- OID
- 058e11…40df:156
GetForm details
ResponseCount
func(id string) intResponseCount returns how many responses the form currently holds.
- OID
- 058e11…40df:157
ResponseCount details
FormCount
func() intFormCount returns how many forms exist.
- OID
- 058e11…40df:158
FormCount details
mustGetForm
func(id string) *test2.Form- OID
- 058e11…40df:159
mustGetForm details
mustUserCaller
func() .uverse.address- OID
- 058e11…40df:160
mustUserCaller details
parseFields
func(labels string, kinds string, required string, options string) []test2.FieldparseFields decodes the four parallel field-spec strings.
- OID
- 058e11…40df:161
parseFields details
splitFields
func(s string) []string- OID
- 058e11…40df:162
splitFields details
formsPerPage
untyped bigintValue
(20 <untyped> bigint)
responsesPerPage
untyped bigintValue
(25 <untyped> bigint)
router
*v0.Router- OID
- 058e11…40df:164
router details
init.46
func()- OID
- 058e11…40df:167
init.46 details
Render
func(path string) stringRender routes: /r/<ns>/forms index of forms /r/<ns>/forms:<id> a form, fillable in gnoweb /r/<ns>/forms:<id>/responses its responses, paginated /r/<ns>/forms:<id>/responses.csv its responses as CSV
- OID
- 058e11…40df:169
Render details
renderIndex
func(res *v0.ResponseWriter, req *v0.Request)- OID
- 058e11…40df:170
renderIndex details
renderForm
func(res *v0.ResponseWriter, req *v0.Request)- OID
- 058e11…40df:171
renderForm details
renderMDForm
func(f *test2.Form) stringrenderMDForm draws the fillable form. gnoweb turns it into an HTML form that calls Submit; each input is named after the Submit parameter it fills.
- OID
- 058e11…40df:172
renderMDForm details
renderResponses
func(res *v0.ResponseWriter, req *v0.Request)- OID
- 058e11…40df:173
renderResponses details
renderCSV
func(res *v0.ResponseWriter, req *v0.Request)renderCSV emits every response as CSV inside a code block, so a reviewer can copy it straight into a spreadsheet.
- OID
- 058e11…40df:174
renderCSV details
renderCreateHelp
func() stringrenderCreateHelp draws the form that creates forms. gnoweb submits it as a CreateForm call with every input mapped to the parameter of the same name.
- OID
- 058e11…40df:175
renderCreateHelp details
statusLabel
func(f *test2.Form, height int64) string- OID
- 058e11…40df:176
statusLabel details
formURL
func(id string) string- OID
- 058e11…40df:177
formURL details
responsesURL
func(id string) string- OID
- 058e11…40df:178
responsesURL details
csvURL
func(id string) string- OID
- 058e11…40df:179
csvURL details
realmPath
stringValue
"gno.land/r/nym-encapsulate001/test2"
realmURL
func() stringrealmURL is this realm's path as gnoweb addresses it, derived from where it is deployed rather than hardcoded.
- OID
- 058e11…40df:181
realmURL details
shortAddr
func(a .uverse.address) string- OID
- 058e11…40df:182
shortAddr details
cell
func(s string) stringcell makes an answer safe inside a markdown table cell.
- OID
- 058e11…40df:183
cell details
csvRow
func(fields []string) stringcsvRow quotes every field, doubling embedded quotes, per RFC 4180.
- OID
- 058e11…40df:184
csvRow details
Submit
func(id string, a1 string, a2 string, a3 string, a4 string, a5 string, a6 string, a7 string, a8 string)Submit records a response to a form. Answers a1..a8 align with the form's fields in order; slots beyond the form's field count must be empty. gnoweb builds this call from the rendered form: each input is named after the parameter it fills, and parameters with no input arrive as "". The respondent pays the storage deposit for their own answers, and gets it back on Withdraw.
- OID
- 058e11…40df:185
Submit details
Withdraw
func(id string)Withdraw deletes the caller's response to a form. The storage deposit the answers were holding is refunded to the caller by the chain. Only the author can withdraw. Owners cannot delete responses: the refund goes to whoever deletes, which would hand the owner the respondent's deposit.
- OID
- 058e11…40df:187
Withdraw details
validateAnswers
func(f *test2.Form, raw []string) []stringvalidateAnswers checks every answer against its field and returns the trimmed answers, exactly len(f.Fields) long. Nothing is written before it returns, so a rejected submission leaves no trace.
- OID
- 058e11…40df:188
validateAnswers details
fieldErr
func(i int, err .uverse.error) string- OID
- 058e11…40df:189
fieldErr details
contains
func(list []string, s string) bool- OID
- 058e11…40df:190
contains details
FieldKind
typeFieldKind is the input type a field renders as, and the validation it gets.
Value
test2.FieldKind
KindText
test2.FieldKindValue
<gnolang.StringValue>
KindTextarea
test2.FieldKindValue
<gnolang.StringValue>
KindNumber
test2.FieldKindValue
<gnolang.StringValue>
KindSelect
test2.FieldKindValue
<gnolang.StringValue>
MaxFields
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(8 <untyped> bigint)
MaxTitleLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(120 <untyped> bigint)
MaxDescriptionLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(2048 <untyped> bigint)
MaxLabelLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(120 <untyped> bigint)
MaxOptionLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(120 <untyped> bigint)
MaxTextLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(256 <untyped> bigint)
MaxTextareaLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(2048 <untyped> bigint)
MaxNumberLen
untyped bigintLimits. Answers are stored on chain and the respondent pays the storage deposit for them, so the caps exist to keep that cost predictable rather than to save the realm anything.
Value
(64 <untyped> bigint)
Field
typeField is one question on a form.
Value
test2.Field
MinSlugLen
untyped bigintSlug rules. A slug is the form's ID and its URL segment, chosen at creation: lowercase letters and digits, single hyphens between words, 3–48 characters.
Value
(3 <untyped> bigint)
MaxSlugLen
untyped bigintSlug rules. A slug is the form's ID and its URL segment, chosen at creation: lowercase letters and digits, single hyphens between words, 3–48 characters.
Value
(48 <untyped> bigint)
Form
typeForm is a published questionnaire and its responses.
Value
test2.Form
Response
typeResponse is one submission to a form. Answers align with Form.Fields.
Value
test2.Response