types

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the module name
	ModuleName = "magpie"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName

RouterKey was defined in your key.go file

Variables

View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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

func NewLike

func NewLike() Like

NewLike returns an empty Like

func (Like) String

func (l Like) String() string

implement fmt.Stringer

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) Type

func (msg MsgCreatePost) Type() string

Type should return the action

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) Type

func (msg MsgEditPost) Type() string

Type should return the action

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

func NewMsgLike(postID string, time time.Time, liker sdk.AccAddress) MsgLike

NewMsgLike is a constructor function for MsgLike

func (MsgLike) GetSignBytes

func (msg MsgLike) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgLike) GetSigners

func (msg MsgLike) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgLike) Route

func (msg MsgLike) Route() string

Route should return the name of the module

func (MsgLike) Type

func (msg MsgLike) Type() string

Type should return the action

func (MsgLike) ValidateBasic

func (msg MsgLike) ValidateBasic() sdk.Error

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

func NewMsgUnlike(id string, time time.Time, liker sdk.AccAddress) MsgUnlike

NewMsgUnlike is the contructor of MsgUnlike

func (MsgUnlike) GetSignBytes

func (msg MsgUnlike) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgUnlike) GetSigners

func (msg MsgUnlike) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgUnlike) Route

func (msg MsgUnlike) Route() string

Route should return the name of the module

func (MsgUnlike) Type

func (msg MsgUnlike) Type() string

Type should return the action

func (MsgUnlike) ValidateBasic

func (msg MsgUnlike) ValidateBasic() sdk.Error

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

func NewPost

func NewPost() Post

NewPost returns an empty Magpie post

func (Post) String

func (p Post) String() string

implement fmt.Stringer

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL