Documentation ¶
Index ¶
Constants ¶
View Source
const (
ModuleName = "posts"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenesisState ¶
type GenesisState struct { Posts []Post `json:"posts"` Reactions map[string][]Reaction `json:"reactions"` }
GenesisState contains the data of a v0.2.0 genesis state for the posts module
func Migrate ¶
func Migrate(oldGenState v010posts.GenesisState, genesisTime time.Time, blockInterval int) GenesisState
Migrate accepts exported genesis state from v0.1.0 and migrates it to v0.2.0 genesis state. This migration changes the data that are saved for each post moving the external reference into the arbitrary data map and adding the new subspace field
type OptionalData ¶
type Post ¶
type Post struct { PostID PostID `json:"id"` // Unique id ParentID PostID `json:"parent_id"` // Post of which this one is a comment Message string `json:"message"` // Message contained inside the post Created time.Time `json:"created"` // RFC3339 date at which the post has been created LastEdited time.Time `json:"last_edited"` // RFC3339 date at which the post has been edited the last time AllowsComments bool `json:"allows_comments"` // Tells if users can reference this PostID as the parent Subspace string `json:"subspace"` // Identifies the application that has posted the message OptionalData OptionalData `json:"optional_data,omitempty"` // Arbitrary data that can be used from the developers Creator sdk.AccAddress `json:"creator"` // Creator of the Post }
Post is a struct of a post
func (Post) ConflictsWith ¶ added in v0.3.0
func (Post) ContentsEquals ¶ added in v0.3.0
ContentsEquals returns true if and only if p and other contain the same data, without considering the ID
type Reaction ¶
type Reaction struct { Owner sdk.AccAddress `json:"owner"` // User that has created the reaction Value string `json:"value"` // Reaction of the reaction }
Reaction is a struct of a user reaction to a post
Click to show internal directories.
Click to hide internal directories.