Documentation
¶
Index ¶
- func ErrFailedToMarshalPostComment(err error) sdk.Error
- func ErrFailedToMarshalPostDonations(err error) sdk.Error
- func ErrFailedToMarshalPostInfo(err error) sdk.Error
- func ErrFailedToMarshalPostMeta(err error) sdk.Error
- func ErrFailedToMarshalPostReportOrUpvote(err error) sdk.Error
- func ErrFailedToMarshalPostView(err error) sdk.Error
- func ErrFailedToUnmarshalPostComment(err error) sdk.Error
- func ErrFailedToUnmarshalPostDonations(err error) sdk.Error
- func ErrFailedToUnmarshalPostInfo(err error) sdk.Error
- func ErrFailedToUnmarshalPostMeta(err error) sdk.Error
- func ErrFailedToUnmarshalPostReportOrUpvote(err error) sdk.Error
- func ErrFailedToUnmarshalPostView(err error) sdk.Error
- func ErrPostCommentNotFound(key []byte) sdk.Error
- func ErrPostDonationNotFound(key []byte) sdk.Error
- func ErrPostMetaNotFound(key []byte) sdk.Error
- func ErrPostNotFound(key []byte) sdk.Error
- func ErrPostReportOrUpvoteNotFound(key []byte) sdk.Error
- func ErrPostViewNotFound(key []byte) sdk.Error
- func GetPostInfoKey(permlink types.Permlink) []byte
- func GetPostMetaKey(permlink types.Permlink) []byte
- type Comment
- type Comments
- type Donations
- type Identifier
- type PostInfo
- type PostMeta
- type PostStorage
- func (ps PostStorage) DoesPostExist(ctx sdk.Context, permlink types.Permlink) bool
- func (ps PostStorage) GetPostComment(ctx sdk.Context, permlink types.Permlink, commentPermlink types.Permlink) (*Comment, sdk.Error)
- func (ps PostStorage) GetPostDonations(ctx sdk.Context, permlink types.Permlink, donateUser types.AccountKey) (*Donations, sdk.Error)
- func (ps PostStorage) GetPostInfo(ctx sdk.Context, permlink types.Permlink) (*PostInfo, sdk.Error)
- func (ps PostStorage) GetPostMeta(ctx sdk.Context, permlink types.Permlink) (*PostMeta, sdk.Error)
- func (ps PostStorage) GetPostReportOrUpvote(ctx sdk.Context, permlink types.Permlink, user types.AccountKey) (*ReportOrUpvote, sdk.Error)
- func (ps PostStorage) GetPostView(ctx sdk.Context, permlink types.Permlink, viewUser types.AccountKey) (*View, sdk.Error)
- func (ps PostStorage) SetPostComment(ctx sdk.Context, permlink types.Permlink, postComment *Comment) sdk.Error
- func (ps PostStorage) SetPostDonations(ctx sdk.Context, permlink types.Permlink, postDonations *Donations) sdk.Error
- func (ps PostStorage) SetPostInfo(ctx sdk.Context, postInfo *PostInfo) sdk.Error
- func (ps PostStorage) SetPostMeta(ctx sdk.Context, permlink types.Permlink, postMeta *PostMeta) sdk.Error
- func (ps PostStorage) SetPostReportOrUpvote(ctx sdk.Context, permlink types.Permlink, reportOrUpvote *ReportOrUpvote) sdk.Error
- func (ps PostStorage) SetPostView(ctx sdk.Context, permlink types.Permlink, postView *View) sdk.Error
- type ReportOrUpvote
- type ReportOrUpvotes
- type URL
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrFailedToMarshalPostInfo ¶
marshal error
func ErrFailedToUnmarshalPostInfo ¶
unmarshal error
func ErrPostCommentNotFound ¶
func ErrPostDonationNotFound ¶
func ErrPostMetaNotFound ¶
func ErrPostViewNotFound ¶
func GetPostInfoKey ¶
func GetPostMetaKey ¶
Types ¶
type Comment ¶
type Comment struct {
Author types.AccountKey `json:"author"`
PostID string `json:"post_id"`
CreatedAt int64 `json:"created_at"`
}
type Donations ¶
type Donations struct {
Username types.AccountKey `json:"username"`
Times int64 `json:"times"`
Amount types.Coin `json:"amount"`
}
type PostInfo ¶
type PostInfo struct {
PostID string `json:"post_id"`
Title string `json:"title"`
Content string `json:"content"`
Author types.AccountKey `json:"author"`
ParentAuthor types.AccountKey `json:"parent_author"`
ParentPostID string `json:"parent_postID"`
SourceAuthor types.AccountKey `json:"source_author"`
SourcePostID string `json:"source_postID"`
Links []types.IDToURLMapping `json:"links"`
}
PostInfo can also use to present comment(with parent) or repost(with source)
type PostMeta ¶
type PostMeta struct {
CreatedAt int64 `json:"created_at"`
LastUpdatedAt int64 `json:"last_updated_at"`
LastActivityAt int64 `json:"last_activity_at"`
AllowReplies bool `json:"allow_replies"`
IsDeleted bool `json:"is_deleted"`
TotalDonateCount int64 `json:"total_donate_count"`
TotalReportStake types.Coin `json:"total_report_stake"`
TotalUpvoteStake types.Coin `json:"total_upvote_stake"`
TotalViewCount int64 `json:"total_view_count"`
TotalReward types.Coin `json:"total_reward"`
RedistributionSplitRate sdk.Rat `json:"redistribution_split_rate"`
}
PostMeta stores tiny and frequently updated fields.
type PostStorage ¶
type PostStorage struct {
// contains filtered or unexported fields
}
func NewPostStorage ¶
func NewPostStorage(key sdk.StoreKey) PostStorage
NewPostStorage returns a new PostStorage that uses go-wire to (binary) encode and decode concrete Post
func (PostStorage) DoesPostExist ¶
func (PostStorage) GetPostComment ¶
func (PostStorage) GetPostDonations ¶
func (ps PostStorage) GetPostDonations( ctx sdk.Context, permlink types.Permlink, donateUser types.AccountKey) (*Donations, sdk.Error)
func (PostStorage) GetPostInfo ¶
func (PostStorage) GetPostMeta ¶
func (PostStorage) GetPostReportOrUpvote ¶
func (ps PostStorage) GetPostReportOrUpvote( ctx sdk.Context, permlink types.Permlink, user types.AccountKey) (*ReportOrUpvote, sdk.Error)
func (PostStorage) GetPostView ¶
func (ps PostStorage) GetPostView( ctx sdk.Context, permlink types.Permlink, viewUser types.AccountKey) (*View, sdk.Error)
func (PostStorage) SetPostComment ¶
func (PostStorage) SetPostDonations ¶
func (PostStorage) SetPostInfo ¶
func (PostStorage) SetPostMeta ¶
func (PostStorage) SetPostReportOrUpvote ¶
func (ps PostStorage) SetPostReportOrUpvote( ctx sdk.Context, permlink types.Permlink, reportOrUpvote *ReportOrUpvote) sdk.Error
func (PostStorage) SetPostView ¶
type ReportOrUpvote ¶
type ReportOrUpvote struct {
Username types.AccountKey `json:"username"`
Stake types.Coin `json:"stake"`
CreatedAt int64 `json:"created_at"`
IsReport bool `json:"is_report"`
}
ReportOrUpvote struct, only used in ReportOrUpvotes
type ReportOrUpvotes ¶
type ReportOrUpvotes []ReportOrUpvote
Click to show internal directories.
Click to hide internal directories.