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

memba_dao_channels_v2 state

Back to all declarations

MaxPostLen

untyped bigint

Value

(5000 <untyped> bigint)

MaxTitleLen

untyped bigint

Value

(200 <untyped> bigint)

MaxChannels

untyped bigint

Value

(20 <untyped> bigint)

MaxThreadsPerChan

untyped bigint

Value

(500 <untyped> bigint)

FlagThreshold

untyped bigint

// flags before auto-hide

Value

(3 <untyped> bigint)

MaxRepliesPerThread

untyped bigint

// live (non-deleted) replies per thread

Value

(500 <untyped> bigint)

ReplyPageSize

untyped bigint

// replies rendered per page

Value

(50 <untyped> bigint)

ChannelType

type

Value

memba_dao_channels_v2.ChannelType

ChannelText

memba_dao_channels_v2.ChannelType

Value

<gnolang.StringValue>

ChannelAnnouncements

memba_dao_channels_v2.ChannelType

Value

<gnolang.StringValue>

ChannelReadonly

memba_dao_channels_v2.ChannelType

Value

<gnolang.StringValue>

Channel

type

Value

memba_dao_channels_v2.Channel

Thread

type

Value

memba_dao_channels_v2.Thread

Reply

type

Value

memba_dao_channels_v2.Reply

threads

*avl.Tree

// "channel/id" -> \*Thread

Open
OID
0bea83…0ede:124
threads details

Inspect pointer

replies

*avl.Tree

// "channel/threadId/replyId" -> \*Reply

Open
OID
0bea83…0ede:126
replies details

Inspect pointer

threadCount

*avl.Tree

// channel -> uint64 (next thread ID, monotonic)

Open
OID
0bea83…0ede:128
threadCount details

Inspect pointer

threadLive

*avl.Tree

// channel -> uint64 (currently live (non-deleted) threads)

Open
OID
0bea83…0ede:152
threadLive details

Inspect pointer

threadLiveIDs

*avl.Tree

// channel -> \[]uint64 (live thread IDs, ascending) — bounds renderChannel

Open
OID
0bea83…0ede:176
threadLiveIDs details

Inspect pointer

replyCount

*avl.Tree

// "channel/threadId" -> uint64 (next reply ID, monotonic)

Open
OID
0bea83…0ede:178
replyCount details

Inspect pointer

replyLive

*avl.Tree

// "channel/threadId" -> uint64 (currently live (non-deleted) replies)

Open
OID
0bea83…0ede:180
replyLive details

Inspect pointer

replyLiveIDs

*avl.Tree

// "channel/threadId" -> \[]uint64 (live reply IDs, ascending) — bounds renderThread

Open
OID
0bea83…0ede:182
replyLiveIDs details

Inspect pointer

threadTomb

*avl.Tree

// channel -> \[]uint64 (soft-deleted thread IDs awaiting hard-GC via SweepTombstones) — B2

Open
OID
0bea83…0ede:184
threadTomb details

Inspect pointer

flags

*avl.Tree

// "channel/threadId" -> \*avl.Tree (flagger addr -> bool)

Open
OID
0bea83…0ede:186
flags details

Inspect pointer

paused

bool

Value

false

owner

.uverse.address

Value

<gnolang.StringValue>

addChannel

func(name string, description string, ctype memba_dao_channels_v2.ChannelType, readRoles []string, writeRoles []string)
Open
OID
0bea83…0ede:20
addChannel details

Inspect func

AddMember

func(addr .uverse.address, roles string)

AddMember adds an address with specified roles. Only the owner can call this. roles is a comma-separated list (e.g., "admin,dev" or "member").

Open
OID
0bea83…0ede:21
AddMember details

Inspect func

RemoveMember

func(addr .uverse.address)

RemoveMember removes an address from the membership. Only the owner can call this.

Open
OID
0bea83…0ede:22
RemoveMember details

Inspect func

UpdateMemberRoles

func(addr .uverse.address, newRoles string)

UpdateMemberRoles updates the roles for an existing member. Only the owner can call this.

Open
OID
0bea83…0ede:23
UpdateMemberRoles details

Inspect func

TransferOwnership

func(newOwner .uverse.address)

TransferOwnership transfers realm ownership to a new address. Only the current owner can call this. The new owner gets "admin" added to their existing roles (not overwritten). The old owner is demoted from "admin" to "member".

Open
OID
0bea83…0ede:24
TransferOwnership details

Inspect func

SyncMembers

func(addresses string, rolesList string)

SyncMembers allows the owner to batch-sync membership from the DAO. addresses and rolesList are comma-separated, with roles pipe-delimited per address. Example: SyncMembers("g1a,g1b", "admin,dev|member")

Open
OID
0bea83…0ede:25
SyncMembers details

Inspect func

PurgeNonMembers

func(keepAddresses string)

PurgeNonMembers removes all members not in the provided comma-separated list. The owner is never purged.

Open
OID
0bea83…0ede:26
PurgeNonMembers details

Inspect func

IsMember

func(addr .uverse.address) bool

IsMember returns whether an address is a member.

Open
OID
0bea83…0ede:27
IsMember details

Inspect func

GetMemberRoles

func(addr .uverse.address) string

GetMemberRoles returns the roles for a member (comma-separated) or empty string.

Open
OID
0bea83…0ede:28
GetMemberRoles details

Inspect func

CreateChannel

func(name string, description string, ctype string)

CreateChannel adds a new channel. Only the owner (admin) can create channels.

Open
OID
0bea83…0ede:34
CreateChannel details

Inspect func

PostThread

func(channel string, title string, body string) uint64

PostThread creates a new thread in a channel. Caller must be a member with a role listed in the channel's WriteRoles.

Open
OID
0bea83…0ede:35
PostThread details

Inspect func

PostReply

func(channel string, threadID uint64, body string)

PostReply adds a reply to a thread. Caller must be a member with a role listed in the channel's WriteRoles.

Open
OID
0bea83…0ede:36
PostReply details

Inspect func

dropReply

func(threadKey string, replyKey string, replyID uint64)

dropReply hard-removes a reply: deletes the node (storage reclaimed — B2), drops it from the live index, and decrements the live count. Shared by DeleteReply and RemoveReply. renderThread only walks the live index, so a removed reply is never looked up — no tombstone is needed.

Open
OID
0bea83…0ede:37
dropReply details

Inspect func

DeleteReply

func(channel string, threadID uint64, replyID uint64)

DeleteReply lets the reply's author delete it. Caller must be a member and the original author. The reply node is hard-removed (B2 state-shrink) and a slot is freed under MaxRepliesPerThread (B1).

Open
OID
0bea83…0ede:38
DeleteReply details

Inspect func

RemoveReply

func(channel string, threadID uint64, replyID uint64)

RemoveReply permanently removes a reply (moderation — admin role only). Hard- removes the node like DeleteReply, bounding renderThread (B1) + reclaiming storage (B2).

Open
OID
0bea83…0ede:39
RemoveReply details

Inspect func

EditThread

func(channel string, threadID uint64, newBody string)

EditThread allows the original author to edit their thread. Caller must be a member.

Open
OID
0bea83…0ede:40
EditThread details

Inspect func

DeleteThread

func(channel string, threadID uint64)

DeleteThread soft-deletes a thread (marks as deleted). Caller must be a member and the original author.

Open
OID
0bea83…0ede:41
DeleteThread details

Inspect func

FlagThread

func(channel string, threadID uint64)

FlagThread flags a thread for moderation review. After FlagThreshold flags, the thread is auto-hidden. Caller must be a member (any role) to flag content.

Open
OID
0bea83…0ede:42
FlagThread details

Inspect func

UnhideThread

func(channel string, threadID uint64)

UnhideThread allows the owner or an admin to clear flags and un-hide a thread.

Open
OID
0bea83…0ede:43
UnhideThread details

Inspect func

RemoveThread

func(channel string, threadID uint64)

RemoveThread permanently removes a thread (moderation action — admin role only).

Open
OID
0bea83…0ede:44
RemoveThread details

Inspect func

SweepTombstones

func(channel string, limit int) int

SweepTombstones hard-removes up to \`limit\` soft-deleted threads in a channel (and all of their remaining reply state), reclaiming AVL storage so that post+delete spam can no longer accrete permanent state (B2). Permissionless GC by design: anyone may call it. Released storage deposits go to the calling tx per the chain's deposit policy (an explicit caller bounty); on restricted-denom chains (e.g. test12/test13 \`restricted\_denoms=\["ugnot"]\`) they route to the StorageFeeCollector instead — so this is a state-shrink/ hygiene primitive, not a user-refund path (see plan B2 / Q11). Bounded + idempotent: each soft-deleted thread holds at most MaxRepliesPerThread reply nodes, so keep \`limit\` small (1–5) to stay well within block gas; re-running drains the next batch and stops at 0. Returns the number of threads swept.

Open
OID
0bea83…0ede:45
SweepTombstones details

Inspect func

GetTombstoneCount

func(channel string) int

GetTombstoneCount returns how many soft-deleted threads in a channel are still awaiting hard-GC (read-only; lets ops/indexers decide when to call SweepTombstones).

Open
OID
0bea83…0ede:46
GetTombstoneCount details

Inspect func

renderHome

func() string

renderHome produces the board home page. Format: parser.ts parseBoardHome() expects: - \[#name](:\_channel/name) 📢 (N threads)

Open
OID
0bea83…0ede:48
renderHome details

Inspect func

renderChannel

func(channelName string) string

renderChannel produces a channel's thread list. Format: parser.ts parseThreadList() expects: ### [Title](:channel/id) by g1addr... | N replies | block H

Open
OID
0bea83…0ede:49
renderChannel details

Inspect func

renderThread

func(channelName string, threadID uint64, page uint64) string

renderThread produces a single thread with replies. Format: parser.ts parseThreadDetail() expects: # Title body --- *Posted by g1addr at block H* *(edited at block M)* ## Replies **g1addr...** (block H) *(edited)* reply body ---

Open
OID
0bea83…0ede:50
renderThread details

Inspect func

parsePageQuery

func(q string) uint64

parsePageQuery extracts the page number from a "?page=N" query string (also tolerates extra &-separated params). Returns 0 (= default/newest) on absence or parse error.

Open
OID
0bea83…0ede:51
parsePageQuery details

Inspect func

pageClamp

func(p uint64, totalPages uint64) uint64

pageClamp keeps a page link within \[1, totalPages].

Open
OID
0bea83…0ede:52
pageClamp details

Inspect func

renderACL

func(channelName string) string

renderACL produces the ACL response for a channel. Format: parser.ts parseACL() expects: read:role1,role2 write:role1,role2,role3 type:text

Open
OID
0bea83…0ede:53
renderACL details

Inspect func

getChannel

func(name string) *memba_dao_channels_v2.Channel
Open
OID
0bea83…0ede:54
getChannel details

Inspect func

getThreadCount

func(channel string) uint64
Open
OID
0bea83…0ede:55
getThreadCount details

Inspect func

getLiveThreadCount

func(channel string) uint64

getLiveThreadCount returns the number of non-deleted threads in a channel. Unlike getThreadCount (monotonic ID counter), this decreases when threads are deleted, so deleted threads free up slots under MaxThreadsPerChan.

Open
OID
0bea83…0ede:56
getLiveThreadCount details

Inspect func

getLiveThreadIDs

func(channel string) []uint64
Open
OID
0bea83…0ede:57
getLiveThreadIDs details

Inspect func

addLiveThreadID

func(channel string, id uint64)
Open
OID
0bea83…0ede:58
addLiveThreadID details

Inspect func

removeLiveThreadID

func(channel string, id uint64)
Open
OID
0bea83…0ede:59
removeLiveThreadID details

Inspect func

getLiveReplyCount

func(threadKey string) uint64
Open
OID
0bea83…0ede:60
getLiveReplyCount details

Inspect func

getLiveReplyIDs

func(threadKey string) []uint64
Open
OID
0bea83…0ede:61
getLiveReplyIDs details

Inspect func

addLiveReplyID

func(threadKey string, id uint64)
Open
OID
0bea83…0ede:62
addLiveReplyID details

Inspect func

removeLiveReplyID

func(threadKey string, id uint64)
Open
OID
0bea83…0ede:63
removeLiveReplyID details

Inspect func

getThreadTomb

func(channel string) []uint64
Open
OID
0bea83…0ede:64
getThreadTomb details

Inspect func

enqueueThreadTomb

func(channel string, id uint64)
Open
OID
0bea83…0ede:65
enqueueThreadTomb details

Inspect func

getReplyCount

func(threadKey string) uint64
Open
OID
0bea83…0ede:66
getReplyCount details

Inspect func

truncAddr

func(addr .uverse.address) string
Open
OID
0bea83…0ede:67
truncAddr details

Inspect func

isValidRoles

func(s string) bool

isValidRoles validates a comma-separated role list contains only safe characters. Allowed: a-z, A-Z, 0-9, hyphen, comma. No spaces, no markdown chars, no null bytes.

Open
OID
0bea83…0ede:68
isValidRoles details

Inspect func

sanitizeForRender

func(s string) string

sanitizeForRender strips markdown-sensitive characters to prevent injection.

Open
OID
0bea83…0ede:69
sanitizeForRender details

Inspect func

assertCallerIsOwner

func()
Open
OID
0bea83…0ede:70
assertCallerIsOwner details

Inspect func

assertCallerIsMember

func(caller .uverse.address)
Open
OID
0bea83…0ede:71
assertCallerIsMember details

Inspect func

assertCallerHasWriteAccess

func(caller .uverse.address, ch *memba_dao_channels_v2.Channel)

assertCallerHasWriteAccess checks that the caller is a member AND has at least one role that matches the channel's WriteRoles.

Open
OID
0bea83…0ede:72
assertCallerHasWriteAccess details

Inspect func

hasRole

func(caller .uverse.address, role string) bool
Open
OID
0bea83…0ede:73
hasRole details

Inspect func

assertCallerIsAdminRole

func()

assertCallerIsAdminRole checks that the caller is a member with the "admin" role. Used for moderation actions (RemoveThread, UnhideThread) so any admin can moderate, not just the single owner.

Open
OID
0bea83…0ede:74
assertCallerIsAdminRole details

Inspect func

isValidChannelName

func(name string) bool

isValidChannelName validates that a channel name contains only lowercase alphanumeric characters and hyphens, and does not start with underscore.

Open
OID
0bea83…0ede:75
isValidChannelName details

Inspect func
MaxPostLen : untyped bigint =(5000 <untyped> bigint)
MaxTitleLen : untyped bigint =(200 <untyped> bigint)
MaxChannels : untyped bigint =(20 <untyped> bigint)
MaxThreadsPerChan : untyped bigint =(500 <untyped> bigint)
FlagThreshold : untyped bigint =(3 <untyped> bigint)
MaxRepliesPerThread : untyped bigint =(500 <untyped> bigint)
ReplyPageSize : untyped bigint =(50 <untyped> bigint)
ChannelType : type =memba_dao_channels_v2.ChannelType
ChannelText : memba_dao_channels_v2.ChannelType =<gnolang.StringValue>
ChannelAnnouncements : memba_dao_channels_v2.ChannelType =<gnolang.StringValue>
ChannelReadonly : memba_dao_channels_v2.ChannelType =<gnolang.StringValue>
Channel : type =memba_dao_channels_v2.Channel
Thread : type =memba_dao_channels_v2.Thread
Reply : type =memba_dao_channels_v2.Reply
channels : *avl.Tree Inspect
threads : *avl.Tree Inspect
replies : *avl.Tree Inspect
threadCount : *avl.Tree Inspect
threadLive : *avl.Tree Inspect
threadLiveIDs : *avl.Tree Inspect
replyCount : *avl.Tree Inspect
replyLive : *avl.Tree Inspect
replyLiveIDs : *avl.Tree Inspect
threadTomb : *avl.Tree Inspect
flags : *avl.Tree Inspect
channelOrder : []string (len=6) Inspect
members : *avl.Tree Inspect
paused : bool =false
owner : .uverse.address =<gnolang.StringValue>
init.29 : func() Inspect
addChannel : func(name string, description string, ctype memba_dao_channels_v2.ChannelType, readRoles []string, writeRoles []string) Inspect
AddMember : func(addr .uverse.address, roles string) Inspect
RemoveMember : func(addr .uverse.address) Inspect
UpdateMemberRoles : func(addr .uverse.address, newRoles string) Inspect
TransferOwnership : func(newOwner .uverse.address) Inspect
SyncMembers : func(addresses string, rolesList string) Inspect
PurgeNonMembers : func(keepAddresses string) Inspect
IsMember : func(addr .uverse.address) bool Inspect
GetMemberRoles : func(addr .uverse.address) string Inspect
GetOwner : func() .uverse.address Inspect
assertNotPaused : func() Inspect
PauseRealm : func() Inspect
UnpauseRealm : func() Inspect
IsPaused : func() bool Inspect
CreateChannel : func(name string, description string, ctype string) Inspect
PostThread : func(channel string, title string, body string) uint64 Inspect
PostReply : func(channel string, threadID uint64, body string) Inspect
dropReply : func(threadKey string, replyKey string, replyID uint64) Inspect
DeleteReply : func(channel string, threadID uint64, replyID uint64) Inspect
RemoveReply : func(channel string, threadID uint64, replyID uint64) Inspect
EditThread : func(channel string, threadID uint64, newBody string) Inspect
DeleteThread : func(channel string, threadID uint64) Inspect
FlagThread : func(channel string, threadID uint64) Inspect
UnhideThread : func(channel string, threadID uint64) Inspect
RemoveThread : func(channel string, threadID uint64) Inspect
SweepTombstones : func(channel string, limit int) int Inspect
GetTombstoneCount : func(channel string) int Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderChannel : func(channelName string) string Inspect
renderThread : func(channelName string, threadID uint64, page uint64) string Inspect
parsePageQuery : func(q string) uint64 Inspect
pageClamp : func(p uint64, totalPages uint64) uint64 Inspect
renderACL : func(channelName string) string Inspect
getChannel : func(name string) *memba_dao_channels_v2.Channel Inspect
getThreadCount : func(channel string) uint64 Inspect
getLiveThreadCount : func(channel string) uint64 Inspect
getLiveThreadIDs : func(channel string) []uint64 Inspect
addLiveThreadID : func(channel string, id uint64) Inspect
removeLiveThreadID : func(channel string, id uint64) Inspect
getLiveReplyCount : func(threadKey string) uint64 Inspect
getLiveReplyIDs : func(threadKey string) []uint64 Inspect
addLiveReplyID : func(threadKey string, id uint64) Inspect
removeLiveReplyID : func(threadKey string, id uint64) Inspect
getThreadTomb : func(channel string) []uint64 Inspect
enqueueThreadTomb : func(channel string, id uint64) Inspect
getReplyCount : func(threadKey string) uint64 Inspect
truncAddr : func(addr .uverse.address) string Inspect
isValidRoles : func(s string) bool Inspect
sanitizeForRender : func(s string) string Inspect
assertCallerIsOwner : func() Inspect
assertCallerIsMember : func(caller .uverse.address) Inspect
assertCallerHasWriteAccess : func(caller .uverse.address, ch *memba_dao_channels_v2.Channel) Inspect
hasRole : func(caller .uverse.address, role string) bool Inspect
assertCallerIsAdminRole : func() Inspect
isValidChannelName : func(name string) bool Inspect