Documentation ¶
Index ¶
Constants ¶
const ( // ModuleName is the module name ModuleName = "magpie" // StoreKey to be used when creating the KVStore StoreKey = ModuleName )
const RouterKey = ModuleName
RouterKey was defined in your key.go file
Variables ¶
var ModuleCdc = codec.New()
ModuleCdc is the codec
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type Like ¶
type Like struct { ID string `json:"id"` PostID string `json:"post_id"` Time time.Time `json:"time"` Owner sdk.AccAddress `json:"owner"` }
Like is a struct of a user like
type MsgCreatePost ¶
type MsgCreatePost struct { Message string `json:"message"` Time time.Time `json:"time"` Owner sdk.AccAddress `json:"owner"` }
MsgCreatePost defines a CreatePost message
func NewMsgCreatePost ¶
func NewMsgCreatePost(message string, time time.Time, owner sdk.AccAddress) MsgCreatePost
NewMsgCreatePost is a constructor function for MsgSetName
func (MsgCreatePost) GetSignBytes ¶
func (msg MsgCreatePost) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgCreatePost) GetSigners ¶
func (msg MsgCreatePost) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgCreatePost) Route ¶
func (msg MsgCreatePost) Route() string
Route should return the name of the module
func (MsgCreatePost) ValidateBasic ¶
func (msg MsgCreatePost) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgEditPost ¶
type MsgEditPost struct { ID string `json:"id"` Message string `json:"message"` Time time.Time `json:"time"` Owner sdk.AccAddress `json:"owner"` }
MsgEditPost defines the EditPost message
func NewMsgEditPost ¶
func NewMsgEditPost(id string, message string, time time.Time, owner sdk.AccAddress) MsgEditPost
NewMsgEditPost is the constructor function for MsgEditPost
func (MsgEditPost) GetSignBytes ¶
func (msg MsgEditPost) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgEditPost) GetSigners ¶
func (msg MsgEditPost) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgEditPost) Route ¶
func (msg MsgEditPost) Route() string
Route should return the name of the module
func (MsgEditPost) ValidateBasic ¶
func (msg MsgEditPost) ValidateBasic() sdk.Error
ValidateBasic runs stateless checks on the message
type MsgLike ¶
type MsgLike struct { PostID string `json:"post_id"` Time time.Time `json:"time"` Liker sdk.AccAddress `json:"liker"` }
MsgLike defines the MsgLike message
func NewMsgLike ¶
NewMsgLike is a constructor function for MsgLike
func (MsgLike) GetSignBytes ¶
GetSignBytes encodes the message for signing
func (MsgLike) GetSigners ¶
func (msg MsgLike) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgLike) ValidateBasic ¶
ValidateBasic runs stateless checks on the message
type MsgUnlike ¶
type MsgUnlike struct { ID string Time time.Time Liker sdk.AccAddress }
MsgUnlike defines the MsgUnlike message
func NewMsgUnlike ¶
NewMsgUnlike is the contructor of MsgUnlike
func (MsgUnlike) GetSignBytes ¶
GetSignBytes encodes the message for signing
func (MsgUnlike) GetSigners ¶
func (msg MsgUnlike) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgUnlike) ValidateBasic ¶
ValidateBasic runs stateless checks on the message
type Post ¶
type Post struct { ID string `json:"id"` Message string `json:"message"` Time time.Time `json:"time"` Likes uint `json:"likes"` Owner sdk.AccAddress `json:"owner"` }
Post is a struct of a Dwiiter post
type QueryResLike ¶
type QueryResLike struct { ID string `json:"ID"` PostID string `json:"post_id"` Owner sdk.AccAddress `json:"owner"` Time time.Time `json:"time"` }
QueryResLike is a result struct
func (QueryResLike) String ¶
func (r QueryResLike) String() string
type QueryResPost ¶
type QueryResPost struct { ID string `json:"ID"` Message string `json:"message"` Owner sdk.AccAddress `json:"owner"` Time time.Time `json:"time"` Likes uint `json:"likes"` }
QueryResPost is a result struct
func (QueryResPost) String ¶
func (r QueryResPost) String() string