package
0.1.0
Repository: https://github.com/iov-one/blog-tutorial.git
Documentation: pkg.go.dev

# README

Blog module

Requirements

This module defines the required components for blog.

  • A blog is where a user posts their article
  • Every user can post article on their blog and has permission delete only their article
  • Blog owner can set a time to delete the article during and after creation
  • Users can like and comment to others articles

State

  • User

    • ID
    • Username
    • Bio
  • Blog

    • ID
    • Owner
    • Title
    • Description
    • CreatedAt
  • Article

    • ID
    • BlogID
    • Title
    • Content
    • CreatedAt
    • DeleteAt
    • CommentCount
    • LikeCount
  • Comment

    • ID
    • ArticleID
    • Owner
    • Content
  • Like

    • ID
    • ArticleID
    • Owner

Messages

  • Create User

    • Username
    • Bio
  • Create Blog

    • Title
    • Description
  • Create Article

    • BlogID
    • Title
    • Content
    • DeleteAt
  • Delete Article

    • ArticleID
    • DeleteAt
  • Create Comment

    • ArticleID
    • Content
  • Like Article

    • ArticleID

# Functions

BuildArticleUserIndex indexByteSize = 8(ArticleID) + 8(UserID).
BuildBlogTimedIndex produces 8 bytes BlogID || big-endian createdAt This allows lexographical searches over the time ranges (or earliest or latest) of all articles within one blog.
NewArticleBucket returns a new article bucket.
NewBlogBucket returns a new blog bucket.
NewCancelDeleteArticleTaskHandler creates a cancel delete article task msg handler.
NewChangeBlogOwnerHandler creates a blog message handler.
NewCommentBucket returns a new comment bucket.
NewCreateArticleHandler creates a article message handler.
NewCreateBlogHandler creates a blog message handler.
NewCreateCommentHandler creates a comment message handler.
NewCreateLikeHandler creates a like message handler.
NewCreateUserHandler creates a user message handler.
NewDeleteArticleHandler creates a article message handler.
NewDeleteArticleTaskBucket returns a new delete article task bucket.
NewLikeBucket returns a new like bucket.
NewUserBucket returns a new user bucket.
RegisterCronRoutes registers routes that are not exposed to routers.
RegisterQuery registers buckets for querying.
RegisterRoutes registers handlers for message processing.

# Variables

No description provided by the author
No description provided by the author

# Structs

Article
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CancelDeleteArticleTaskHandler will handle CancelDeleteArticleTaskMsg.
CancelDeleteArticleTaskMsg message cancelles scheduled article deletion.
ChangeBlogOwnerHandler will handle ChangeBlogOWnerMsg.
No description provided by the author
No description provided by the author
No description provided by the author
CreateArticleHandler will handle CreateArticleMsg.
No description provided by the author
CreateBlogHandler will handle CreateBlogMsg.
No description provided by the author
CreateCommentHandler will handle CreateCommentMsg.
No description provided by the author
CreateLikeHander will handle CreateLikeMsg.
No description provided by the author
CreateUserHandler will handle CreateUserMsg.
No description provided by the author
CronDeleteArticleHandler will handle scheduled DeleteArticleMsg.
DeleteArticleHandler will handle DeleteArticleMsg.
DeleteArticleMsg message deletes the the article instantly.
DeleteArticleTask is used for representing scheduled task id.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author