boards source realm
1
9
func DeletePost
crossing Actionfunc EditPost
crossing Actionfunc Render
func RenderBoard
Actionfunc CreateBoard
crossing Actionfunc GetBoardIDFromName
Actionfunc CreateReply
crossing Actionfunc CreateRepost
crossing Action1func CreateRepost(cur realm, bid BoardID, postid PostID, title string, body string, dstBoardID BoardID) PostIDIf dstBoard is private, does not ping back. If board specified by bid is private, panics.
func CreateThread
crossing Action5
type Board
structMethods on Board
func AddThread
method on Boardfunc DeleteThread
method on BoardNOTE: this can be potentially very expensive for threads with many replies. TODO: implement optional fast-delete where thread is simply moved.
func GetPostFormURL
method on Boardfunc GetThread
method on Boardfunc GetURLFromThreadAndReplyID
method on Boardfunc HasPermission
method on Boardfunc IsPrivate
method on Boardfunc RenderBoard
method on BoardRenders the board for display suitable as plaintext in console. This is suitable for demonstration or tests, but not for prod.
type BoardID
identtype Permission
identtype Post
struct 1type Post struct {
2 board *Board
3 id PostID
4 creator address
5 title string // optional
6 body string
7 replies avl.Tree // Post.id -> *Post
8 repliesAll avl.Tree // Post.id -> *Post (all replies, for top-level posts)
9 reposts avl.Tree // Board.id -> Post.id
10 threadID PostID // original Post.id
11 parentID PostID // parent Post.id (if reply or repost)
12 repostBoard BoardID // original Board.id (if repost)
13 createdAt time.Time
14 updatedAt time.Time
15}A Post is a "thread" or a "reply" depending on context. A thread is a Post of a Board that holds other replies.
Methods on Post
func AddReply
method on Postfunc AddRepostTo
method on Postfunc DeletePost
method on Postfunc GetDeleteFormURL
method on Postfunc GetPostID
method on Postfunc GetReply
method on Postfunc GetReplyFormURL
method on Postfunc GetRepostFormURL
method on Postfunc GetSummary
method on Postfunc GetURL
method on Postfunc HasPermission
method on Postfunc IsThread
method on Postfunc RenderInner
method on Postrender reply and link to context thread
func RenderPost
method on Postfunc RenderSummary
method on Postfunc Update
method on Posttype PostID
identNOTE: a PostID is relative to the board.
9
- chain stdlib
- chain/runtime/unsafe stdlib
- gno.land/p/moul/txlink package
- gno.land/p/nt/avl/v0 package
- gno.land/r/sys/users realm
- regexp stdlib
- strconv stdlib
- strings stdlib
- time stdlib