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_notes_v1 source realm

Package memba\_notes\_v1 stores versioned Markdown notes and their receipts. Publication is immutable; deployment is ...

Overview

Package memba_notes_v1 stores versioned Markdown notes and their receipts. Publication is immutable; deployment is gated on the complete contract audit.

Constants 19

const MaxGovPayloadBytes

1const MaxGovPayloadBytes = MaxCipherTitleBytes + MaxCipherBodyBytes + MaxManifestBytes + 128
source

const RealmPath

1const RealmPath = "gno.land/r/samcrew/memba_notes_v1"
source

const RedactedTitle

1const RedactedTitle = "Redacted by moderation"
source

RedactedTitle replaces a redacted current title, which must stay valid.

Functions 72

func AddComment

crossing Action
1func AddComment(cur realm, id, cid [16]byte, bodyRevision uint64, epoch uint32, parent [16]byte, anchor, body []byte, opID [16]byte)
source

Public comments carry UTF8 anchor/body separately. Encrypted comments will carry their combined authenticated payload in Body and an empty Anchor.

func AddWriter

crossing Action
1func AddWriter(cur realm, id [16]byte, baseRevision uint64, to address, opID [16]byte)
source

func ApplyAccess

crossing Action
1func ApplyAccess(cur realm, id [16]byte, baseRevision uint64, expectedEpoch uint32, mode uint8, manifest []byte, opID [16]byte)
source

ApplyAccess grants access to the CURRENT epoch and its history. Removing a reader/writer or changing link scope requires Rotate, never this entrypoint.

func CommentsJSON

Action
1func CommentsJSON(idHex, cursor string, limit int) string
source

Comments paginate in append order; editing or moderation never reorders them.

func Commit

crossing Action
1func Commit(cur realm, id [16]byte, baseRevision uint64, expectedEpoch uint32, fieldMask uint8, title, body []byte, opID [16]byte)
source

fieldMask: 1 title, 2 body, 3 both. An unchanged field must be omitted (empty blob). The separate field revision advances only when that field changes.

func CreateNote

crossing Action
1func CreateNote(cur realm, id [16]byte, mode uint8, title, body, access, commitment []byte, maxFee int64, opID [16]byte)
source

CreateNote is the only payable entrypoint; encrypted creation is atomic.

func Delete

crossing Action
1func Delete(cur realm, id [16]byte, baseRevision uint64, opID [16]byte)
source

Delete retains the ID and last operation receipt forever. Large collections are purged by bounded follow-up calls, never by an unbounded delete loop.

func GovApply

crossing Action
1func GovApply(cur realm, pid uint64, id [16]byte, baseRevision, ownerGeneration uint64, expectedEpoch uint32, action string, payload []byte, opID [16]byte)
source

func GovDigest

Action
1func GovDigest(idHex string, baseRevision, ownerGeneration uint64, expectedEpoch uint32, action string, payload []byte, opID [16]byte) string
source

func GrantAccess

crossing Action
1func GrantAccess(cur realm, id [16]byte, baseRevision uint64, expectedEpoch uint32, manifest []byte, opID [16]byte)
source

A holder may grant a read-policy-approved recipient the current epoch. Every existing entry must remain byte-identical: a grantee cannot corrupt someone else's wrap, change writers, remove access or rotate the owner into new keys.

func HideComment

crossing Action
1func HideComment(cur realm, id, cid [16]byte, baseRevision uint64, hidden bool, opID [16]byte)
source

func ModerateListing

crossing Action
1func ModerateListing(cur realm, id [16]byte, baseRevision uint64, visible bool, opID [16]byte)
source

Directory moderation is separate from owner discoverability. Owners cannot undo a moderation hide by toggling their own listing preference.

func NoteBodyChunkJSON

Action
1func NoteBodyChunkJSON(idHex string, expectedRevision uint64, offset, limit int) string
source

Each page is tied to the complete state revision, including access/mode and epoch changes. Clients concatenate binary chunks before decoding UTF8/AEAD.

func ProposeOwner

crossing Action
1func ProposeOwner(cur realm, id [16]byte, baseRevision uint64, to address, opID [16]byte)
source

func PublicHistoryBodyChunkJSON

Action
1func PublicHistoryBodyChunkJSON(idHex string, seq uint64, offset, limit int) string
source

PublicHistoryBodyChunkJSON reads the body of the version recorded by the note-level event seq (a version's recorded_seq). A later note-level event that kept the body returns the same body; comment and cleanup events, deletion versions, unknown seqs and redacted bodies return null.

func PublicHistoryVersionJSON

Action
1func PublicHistoryVersionJSON(idHex string, stateRevision uint64) string
source

PublicHistoryVersionJSON reads the public state recorded at a state revision. recorded_seq is the event that recorded it; PublicHistoryBodyChunkJSON and RedactPublicContentAtSeq address that version by this seq.

func Publish

crossing Action
1func Publish(cur realm, id [16]byte, baseRevision uint64, mode uint8, title, body []byte, opID [16]byte)
source

func Purge

crossing Action
1func Purge(cur realm, id [16]byte, limit int) int
source

Purge never operates on a live note. Each call erases at most limit records (including cooldowns); a permanent note tombstone prevents ID reuse.

func PurgeExpiredRequests

crossing Action
1func PurgeExpiredRequests(cur realm, id [16]byte, cursor string, limit int) string
source

At most limit records are inspected, not just removed. The returned cursor lets a caller sweep the full request set without an unbounded scan.

func RedactPublicComment

crossing Action
1func RedactPublicComment(cur realm, id, cid [16]byte, baseRevision uint64, opID [16]byte)
source

RedactPublicComment removes a public comment's anchor and body from both the live comment (which becomes hidden and cannot be shown again) and its public history. A purged comment keeps only its history record, which is redacted the same way; baseRevision is then ignored (pass 0).

func RedactPublicContentAtSeq

crossing Action
1func RedactPublicContentAtSeq(cur realm, id [16]byte, baseRevision uint64, field uint8, seq uint64, opID [16]byte)
source

RedactPublicContentAtSeq removes one public title (field 1) or body (field 2) from realm storage: the one recorded by the note-level history event seq (a version's recorded_seq). The name carries the addressing so a caller written for field revisions cannot act on the wrong version. History stores each field revision once, so every version that kept that title or body shows it redacted. Public history keeps its SHA-256 and a content-redact entry naming the moderator and the field revision. Redacting the current version also replaces it (placeholder title, empty body) under a new field revision. Gno refunds the freed storage to the moderator who frees it.

func RefreshOwnWrap

crossing Action
1func RefreshOwnWrap(cur realm, id [16]byte, baseRevision uint64, expectedEpoch uint32, manifest []byte, opID [16]byte)
source

RefreshOwnWrap changes only the caller's identity envelope. It cannot change roles, readers, modes or epochs, and never rewrites anybody else's recovery.

func RemoveWriter

crossing Action
1func RemoveWriter(cur realm, id [16]byte, baseRevision uint64, to address, opID [16]byte)
source

func Rename

crossing Action
1func Rename(cur realm, id [16]byte, baseRevision uint64, expectedEpoch uint32, title []byte, opID [16]byte)
source

func Render

1func Render(path string) string
source

gnoweb uses bounded pages. A revision in every continuation link prevents assembling a whitepaper from different edits; the app reads binary chunks.

func ResolveComment

crossing Action
1func ResolveComment(cur realm, id, cid [16]byte, baseRevision uint64, resolved bool, opID [16]byte)
source

func Reveal

crossing Action
1func Reveal(cur realm, id [16]byte, baseRevision uint64, epoch uint32, key []byte, opID [16]byte)
source

func Rotate

crossing Action
1func Rotate(cur realm, id [16]byte, baseRevision uint64, expectedEpoch uint32, mode uint8, title, body, manifest, kc []byte, opID [16]byte)
source

Rotate installs the entire next epoch in one transaction. Historical epoch records stay available until Delete+boundedPurge; rotation never scans them.

func SetListed

crossing Action
1func SetListed(cur realm, id [16]byte, baseRevision uint64, listed bool, opID [16]byte)
source

func SetPolicy

crossing Action
1func SetPolicy(cur realm, id [16]byte, baseRevision uint64, op uint8, key string, opID [16]byte)
source

Types 1

type Policy

interface
1type Policy interface {
2	Allows(cur realm, id [16]byte, who address, op uint8) bool
3}
source

The realm parameter forces an explicit crossing: adapters run with their own realm identity. All mutators retain the busy guard throughout callbacks.

Imports 18

Source Files 23