Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

test2 state

Back to all declarations

ErrTooManyFields

*errors.errorString
Open
OID
058e11…40df:25
ErrTooManyFields details

Inspect pointer

ErrFieldSpecMismatch

*errors.errorString
Open
OID
058e11…40df:28
ErrFieldSpecMismatch details

Inspect pointer

ErrSelectNoOptions

*errors.errorString
Open
OID
058e11…40df:34
ErrSelectNoOptions details

Inspect pointer

ErrDescriptionTooLong

*errors.errorString
Open
OID
058e11…40df:49
ErrDescriptionTooLong details

Inspect pointer

ErrDeadlinePassed

*errors.errorString
Open
OID
058e11…40df:55
ErrDeadlinePassed details

Inspect pointer

ErrAlreadyResponded

*errors.errorString
Open
OID
058e11…40df:58
ErrAlreadyResponded details

Inspect pointer

ErrAnswerTooLong

*errors.errorString
Open
OID
058e11…40df:73
ErrAnswerTooLong details

Inspect pointer

ErrTooManyAnswers

*errors.errorString
Open
OID
058e11…40df:76
ErrTooManyAnswers details

Inspect pointer

nextRespID

v0.ID

Value

<zero>

Create

func(slug string, title string, description string, labels string, kinds string, required string, options string, onePerAddr bool, deadline int64) string

Create 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.

Open
OID
058e11…40df:148
Create details

Inspect func

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) string

CreateForm 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.

Open
OID
058e11…40df:150
CreateForm details

Inspect func

boolFlag

func(s string) string

boolFlag normalises what a checkbox or a human might send to "1" or "0".

Open
OID
058e11…40df:151
boolFlag details

Inspect func

create

func(slug string, title string, description string, labels string, kinds string, required string, options string, onePerAddr bool, deadline int64) string
Open
OID
058e11…40df:152
create details

Inspect func

Close

func(id string)

Close stops a form from accepting responses. Owner only.

Open
OID
058e11…40df:153
Close details

Inspect func

Reopen

func(id string)

Reopen lets a closed form accept responses again. Owner only. A form whose deadline has passed stays closed regardless.

Open
OID
058e11…40df:154
Reopen details

Inspect func

TransferOwnership

func(id string, to .uverse.address)

TransferOwnership hands a form to another address. Owner only.

Open
OID
058e11…40df:155
TransferOwnership details

Inspect func

GetForm

func(id string) (*test2.Form, bool)

GetForm returns a form by ID.

Open
OID
058e11…40df:156
GetForm details

Inspect func

ResponseCount

func(id string) int

ResponseCount returns how many responses the form currently holds.

Open
OID
058e11…40df:157
ResponseCount details

Inspect func

FormCount

func() int

FormCount returns how many forms exist.

Open
OID
058e11…40df:158
FormCount details

Inspect func

mustGetForm

func(id string) *test2.Form
Open
OID
058e11…40df:159
mustGetForm details

Inspect func

mustUserCaller

func() .uverse.address
Open
OID
058e11…40df:160
mustUserCaller details

Inspect func

parseFields

func(labels string, kinds string, required string, options string) []test2.Field

parseFields decodes the four parallel field-spec strings.

Open
OID
058e11…40df:161
parseFields details

Inspect func

splitFields

func(s string) []string
Open
OID
058e11…40df:162
splitFields details

Inspect func

formsPerPage

untyped bigint

Value

(20 <untyped> bigint)

responsesPerPage

untyped bigint

Value

(25 <untyped> bigint)

Render

func(path string) string

Render 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

Open
OID
058e11…40df:169
Render details

Inspect func

renderIndex

func(res *v0.ResponseWriter, req *v0.Request)
Open
OID
058e11…40df:170
renderIndex details

Inspect func

renderForm

func(res *v0.ResponseWriter, req *v0.Request)
Open
OID
058e11…40df:171
renderForm details

Inspect func

renderMDForm

func(f *test2.Form) string

renderMDForm draws the fillable form. gnoweb turns it into an HTML form that calls Submit; each input is named after the Submit parameter it fills.

Open
OID
058e11…40df:172
renderMDForm details

Inspect func

renderResponses

func(res *v0.ResponseWriter, req *v0.Request)
Open
OID
058e11…40df:173
renderResponses details

Inspect func

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.

Open
OID
058e11…40df:174
renderCSV details

Inspect func

renderCreateHelp

func() string

renderCreateHelp draws the form that creates forms. gnoweb submits it as a CreateForm call with every input mapped to the parameter of the same name.

Open
OID
058e11…40df:175
renderCreateHelp details

Inspect func

statusLabel

func(f *test2.Form, height int64) string
Open
OID
058e11…40df:176
statusLabel details

Inspect func

responsesURL

func(id string) string
Open
OID
058e11…40df:178
responsesURL details

Inspect func

realmPath

string

Value

"gno.land/r/nym-encapsulate001/test2"

realmURL

func() string

realmURL is this realm's path as gnoweb addresses it, derived from where it is deployed rather than hardcoded.

Open
OID
058e11…40df:181
realmURL details

Inspect func

shortAddr

func(a .uverse.address) string
Open
OID
058e11…40df:182
shortAddr details

Inspect func

cell

func(s string) string

cell makes an answer safe inside a markdown table cell.

Open
OID
058e11…40df:183
cell details

Inspect func

csvRow

func(fields []string) string

csvRow quotes every field, doubling embedded quotes, per RFC 4180.

Open
OID
058e11…40df:184
csvRow details

Inspect func

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.

Open
OID
058e11…40df:185
Submit details

Inspect func

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.

Open
OID
058e11…40df:187
Withdraw details

Inspect func

validateAnswers

func(f *test2.Form, raw []string) []string

validateAnswers 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.

Open
OID
058e11…40df:188
validateAnswers details

Inspect func

fieldErr

func(i int, err .uverse.error) string
Open
OID
058e11…40df:189
fieldErr details

Inspect func

contains

func(list []string, s string) bool
Open
OID
058e11…40df:190
contains details

Inspect func

FieldKind

type

FieldKind is the input type a field renders as, and the validation it gets.

Value

test2.FieldKind

KindText

test2.FieldKind

Value

<gnolang.StringValue>

KindTextarea

test2.FieldKind

Value

<gnolang.StringValue>

KindNumber

test2.FieldKind

Value

<gnolang.StringValue>

KindSelect

test2.FieldKind

Value

<gnolang.StringValue>

MaxFields

untyped bigint

Limits. 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 bigint

Limits. 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 bigint

Limits. 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 bigint

Limits. 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 bigint

Limits. 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 bigint

Limits. 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 bigint

Limits. 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 bigint

Limits. 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

type

Field is one question on a form.

Value

test2.Field

MinSlugLen

untyped bigint

Slug 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 bigint

Slug 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

type

Form is a published questionnaire and its responses.

Value

test2.Form

Response

type

Response is one submission to a form. Answers align with Form.Fields.

Value

test2.Response
ErrFormNotFound : *errors.errorString Inspect
ErrBadSlug : *errors.errorString Inspect
ErrSlugTaken : *errors.errorString Inspect
ErrFormClosed : *errors.errorString Inspect
ErrFormOpen : *errors.errorString Inspect
ErrNotOwner : *errors.errorString Inspect
ErrNoFields : *errors.errorString Inspect
ErrTooManyFields : *errors.errorString Inspect
ErrFieldSpecMismatch : *errors.errorString Inspect
ErrBadFieldKind : *errors.errorString Inspect
ErrSelectNoOptions : *errors.errorString Inspect
ErrEmptyLabel : *errors.errorString Inspect
ErrPipeInField : *errors.errorString Inspect
ErrEmptyTitle : *errors.errorString Inspect
ErrTitleTooLong : *errors.errorString Inspect
ErrDescriptionTooLong : *errors.errorString Inspect
ErrBadDeadline : *errors.errorString Inspect
ErrDeadlinePassed : *errors.errorString Inspect
ErrAlreadyResponded : *errors.errorString Inspect
ErrNoResponse : *errors.errorString Inspect
ErrRequired : *errors.errorString Inspect
ErrNotANumber : *errors.errorString Inspect
ErrNotAnOption : *errors.errorString Inspect
ErrAnswerTooLong : *errors.errorString Inspect
ErrTooManyAnswers : *errors.errorString Inspect
ErrNotUserCall : *errors.errorString Inspect
forms : *v0.Tree Inspect
nextRespID : v0.ID =<zero>
slugRe : *regexp.Regexp Inspect
Create : func(slug string, title string, description string, labels string, kinds string, required string, options string, onePerAddr bool, deadline int64) string Inspect
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) string Inspect
boolFlag : func(s string) string Inspect
create : func(slug string, title string, description string, labels string, kinds string, required string, options string, onePerAddr bool, deadline int64) string Inspect
Close : func(id string) Inspect
Reopen : func(id string) Inspect
TransferOwnership : func(id string, to .uverse.address) Inspect
GetForm : func(id string) (*test2.Form, bool) Inspect
ResponseCount : func(id string) int Inspect
FormCount : func() int Inspect
mustGetForm : func(id string) *test2.Form Inspect
mustUserCaller : func() .uverse.address Inspect
parseFields : func(labels string, kinds string, required string, options string) []test2.Field Inspect
splitFields : func(s string) []string Inspect
formsPerPage : untyped bigint =(20 <untyped> bigint)
responsesPerPage : untyped bigint =(25 <untyped> bigint)
router : *v0.Router Inspect
init.46 : func() Inspect
Render : func(path string) string Inspect
renderIndex : func(res *v0.ResponseWriter, req *v0.Request) Inspect
renderForm : func(res *v0.ResponseWriter, req *v0.Request) Inspect
renderMDForm : func(f *test2.Form) string Inspect
renderResponses : func(res *v0.ResponseWriter, req *v0.Request) Inspect
renderCSV : func(res *v0.ResponseWriter, req *v0.Request) Inspect
renderCreateHelp : func() string Inspect
statusLabel : func(f *test2.Form, height int64) string Inspect
formURL : func(id string) string Inspect
responsesURL : func(id string) string Inspect
csvURL : func(id string) string Inspect
realmPath : string ="gno.land/r/nym-encapsulate001/test2"
realmURL : func() string Inspect
shortAddr : func(a .uverse.address) string Inspect
cell : func(s string) string Inspect
csvRow : func(fields []string) string Inspect
Submit : func(id string, a1 string, a2 string, a3 string, a4 string, a5 string, a6 string, a7 string, a8 string) Inspect
Withdraw : func(id string) Inspect
validateAnswers : func(f *test2.Form, raw []string) []string Inspect
fieldErr : func(i int, err .uverse.error) string Inspect
contains : func(list []string, s string) bool Inspect
FieldKind : type =test2.FieldKind
KindText : test2.FieldKind =<gnolang.StringValue>
KindTextarea : test2.FieldKind =<gnolang.StringValue>
KindNumber : test2.FieldKind =<gnolang.StringValue>
KindSelect : test2.FieldKind =<gnolang.StringValue>
MaxFields : untyped bigint =(8 <untyped> bigint)
MaxTitleLen : untyped bigint =(120 <untyped> bigint)
MaxDescriptionLen : untyped bigint =(2048 <untyped> bigint)
MaxLabelLen : untyped bigint =(120 <untyped> bigint)
MaxOptionLen : untyped bigint =(120 <untyped> bigint)
MaxTextLen : untyped bigint =(256 <untyped> bigint)
MaxTextareaLen : untyped bigint =(2048 <untyped> bigint)
MaxNumberLen : untyped bigint =(64 <untyped> bigint)
Field : type =test2.Field
MinSlugLen : untyped bigint =(3 <untyped> bigint)
MaxSlugLen : untyped bigint =(48 <untyped> bigint)
Form : type =test2.Form
Response : type =test2.Response