selfPath
untyped stringselfPath is this realm's own page. A root-relative link resolves against the domain, not the realm, so every link back into it names it in full.
Value
"/r/moul/x/daily/polls/v1"
Poll
typePoll is a single question with its options and per-address vote tracking.
Value
v1.Poll
polls
[]*v1.Poll// index i holds the poll with ID i
Value
<zero>
nextID
intValue
0
CreatePoll
func(question string, options string) intCreatePoll registers a new poll. options is a comma-separated list; blank entries are dropped. Returns the new poll's id. Crossing function: an EOA invokes it via MsgCall; another realm via polls.CreatePoll(cross, q, opts).
- OID
- 05182b…56b9:5
CreatePoll details
Vote
func(pollID int, optionIndex int)Vote casts one vote for optionIndex on poll pollID. Each caller address may vote at most once per poll. Crossing function.
- OID
- 05182b…56b9:7
Vote details
parseOptions
func(options string) []stringparseOptions splits a comma-separated option string, trimming whitespace and dropping empties. Pure logic — no realm state.
- OID
- 05182b…56b9:8
parseOptions details
getPoll
func(id int) *v1.PollgetPoll returns the poll with the given id or panics if it does not exist.
- OID
- 05182b…56b9:9
getPoll details
PollCount
func() intPollCount returns the number of polls created so far (read-only helper).
- OID
- 05182b…56b9:10
PollCount details
barWidth
untyped bigintValue
(20 <untyped> bigint)
MaxPolls
untyped bigintThe bounds on what a creator may store. Anyone may create a poll, and the root page renders the newest ones.
Value
(500 <untyped> bigint)
MaxQuestionLen
untyped bigintThe bounds on what a creator may store. Anyone may create a poll, and the root page renders the newest ones.
Value
(200 <untyped> bigint)
MaxOptions
untyped bigintThe bounds on what a creator may store. Anyone may create a poll, and the root page renders the newest ones.
Value
(10 <untyped> bigint)
MaxOptionLen
untyped bigintThe bounds on what a creator may store. Anyone may create a poll, and the root page renders the newest ones.
Value
(64 <untyped> bigint)
IndexRecent
untyped bigint// polls the root page shows, newest first
Value
(20 <untyped> bigint)
bar
func(count int, total int) stringbar renders a proportional ▓░ bar of fixed width for count out of total.
- OID
- 05182b…56b9:11
bar details
percent
func(count int, total int) intpercent returns the integer percentage of count out of total.
- OID
- 05182b…56b9:12
percent details
total
func(tallies []int) inttotal sums a tally slice.
- OID
- 05182b…56b9:13
total details
renderPoll
func(b *strings.Builder, p *v1.Poll)renderPoll writes one poll's Markdown block into b.
- OID
- 05182b…56b9:14
renderPoll details
Render
func(path string) stringRender produces the Markdown page for gnoweb. It is NOT a crossing function. - "" -> the IndexRecent newest polls - "page/\<n>" -> the n-th page of IndexRecent, newest first (page/1 is "") - "\<id>" -> a single poll by id
- OID
- 05182b…56b9:15
Render details
caller
func() .uverse.address- OID
- 05182b…56b9:16