types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	ModuleName                      = common.ModuleName
	RouterKey                       = common.RouterKey
	StoreKey                        = common.StoreKey
	MaxPostMessageLength            = common.MaxPostMessageLength
	MaxOptionalDataFieldsNumber     = common.MaxOptionalDataFieldsNumber
	MaxOptionalDataFieldValueLength = common.MaxOptionalDataFieldValueLength
	ActionCreatePost                = common.ActionCreatePost
	ActionEditPost                  = common.ActionEditPost
	ActionAnswerPoll                = common.ActionAnswerPoll
	ActionAddPostReaction           = common.ActionAddPostReaction
	ActionRemovePostReaction        = common.ActionRemovePostReaction
	ActionRegisterReaction          = common.ActionRegisterReaction
	QuerierRoute                    = common.QuerierRoute
	QueryPost                       = common.QueryPost
	QueryPosts                      = common.QueryPosts
	QueryPollAnswers                = common.QueryPollAnswers
	QueryRegisteredReactions        = common.QueryRegisteredReactions
	PostSortByCreationDate          = common.PostSortByCreationDate
	PostSortByID                    = common.PostSortByID
	PostSortOrderAscending          = common.PostSortOrderAscending
	PostSortOrderDescending         = common.PostSortOrderDescending
)
View Source
const (
	EventTypePostCreated         = "post_created"
	EventTypePostEdited          = "post_edited"
	EventTypePostReactionAdded   = "post_reaction_added"
	EventTypePostReactionRemoved = "post_reaction_removed"
	EventTypeAnsweredPoll        = "post_poll_answered"
	EventTypeClosePoll           = "post_poll_closed"
	EventTypeRegisterReaction    = "reaction_registered"

	// Post attributes
	AttributeKeyPostID       = "post_id"
	AttributeKeyPostParentID = "post_parent_id"
	AttributeKeyPostOwner    = "post_owner"
	AttributeKeyPostEditTime = "post_edit_time"

	// Poll attributes
	AttributeKeyPollAnswerer = "poll_answerer"

	// PostReaction attributes
	AttributeKeyPostReactionOwner = "user"
	AttributeKeyPostReactionValue = "reaction"

	// Reaction attributes
	AttributeKeyReactionCreator   = "creator"
	AttributeKeyReactionShortCode = "shortcode"
	AttributeKeyReactionSubSpace  = "subspace"

	// Generic attributes
	AttributeKeyCreationTime = "creation_time"
)

Magpie module event types

Variables

View Source
var (
	// functions aliases
	RegisterModelsCodec      = models.RegisterModelsCodec
	PostStoreKey             = models.PostStoreKey
	PostCommentsStoreKey     = models.PostCommentsStoreKey
	PostReactionsStoreKey    = models.PostReactionsStoreKey
	ReactionsStoreKey        = models.ReactionsStoreKey
	PollAnswersStoreKey      = models.PollAnswersStoreKey
	ComputeID                = models.ComputeID
	ParsePostID              = models.ParsePostID
	NewPost                  = models.NewPost
	NewPostResponse          = models.NewPostResponse
	NewReactionQueryResponse = models.NewReactionQueryResponse
	NewPostMedia             = common.NewPostMedia
	ValidateURI              = common.ValidateURI
	NewPostMedias            = common.NewPostMedias
	ParseAnswerID            = polls.ParseAnswerID
	NewPollAnswer            = polls.NewPollAnswer
	NewPollAnswers           = polls.NewPollAnswers
	NewPollData              = polls.NewPollData
	ArePollDataEquals        = polls.ArePollDataEquals
	NewUserAnswer            = polls.NewUserAnswer
	NewUserAnswers           = polls.NewUserAnswers
	NewPostReaction          = reactions.NewPostReaction
	NewPostReactions         = reactions.NewPostReactions
	NewReaction              = reactions.NewReaction
	IsEmoji                  = reactions.IsEmoji
	NewReactions             = reactions.NewReactions
	RegisterMessagesCodec    = msgs.RegisterMessagesCodec
	NewMsgCreatePost         = msgs.NewMsgCreatePost
	NewMsgEditPost           = msgs.NewMsgEditPost
	NewMsgAnswerPoll         = msgs.NewMsgAnswerPoll
	NewMsgAddPostReaction    = msgs.NewMsgAddPostReaction
	NewMsgRemovePostReaction = msgs.NewMsgRemovePostReaction
	NewMsgRegisterReaction   = msgs.NewMsgRegisterReaction

	// variable aliases
	MsgsCodec                = msgs.MsgsCodec
	ModelsCdc                = models.ModelsCdc
	Sha256RegEx              = common.Sha256RegEx
	HashtagRegEx             = common.HashtagRegEx
	ShortCodeRegEx           = common.ShortCodeRegEx
	URIRegEx                 = common.URIRegEx
	ModuleAddress            = common.ModuleAddress
	PostStorePrefix          = common.PostStorePrefix
	PostCommentsStorePrefix  = common.PostCommentsStorePrefix
	PostReactionsStorePrefix = common.PostReactionsStorePrefix
	ReactionsStorePrefix     = common.ReactionsStorePrefix
	PollAnswersStorePrefix   = common.PollAnswersStorePrefix
)
View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec used inside the whole posts module

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

func ValidateGenesis added in v0.2.0

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the given genesis state and returns an error if something is invalid

Types

type AnswerID added in v0.3.0

type AnswerID = polls.AnswerID

type GenesisState added in v0.2.0

type GenesisState struct {
	Posts               Posts                    `json:"posts"`
	UsersPollAnswers    map[string]UserAnswers   `json:"users_poll_answers"`
	PostReactions       map[string]PostReactions `json:"post_reactions"`
	RegisteredReactions Reactions                `json:"registered_reactions"`
}

GenesisState contains the data of the genesis state for the posts module

func DefaultGenesisState added in v0.2.0

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default GenesisState

func NewGenesisState added in v0.3.0

func NewGenesisState(posts Posts, postReactions map[string]PostReactions, registeredR Reactions) GenesisState

NewGenesisState creates a new genesis state

type KeyValue added in v0.2.0

type KeyValue = common.KeyValue

type MsgAddPostReaction added in v0.2.0

type MsgAddPostReaction = msgs.MsgAddPostReaction

type MsgAnswerPoll added in v0.3.0

type MsgAnswerPoll = msgs.MsgAnswerPoll

type MsgCreatePost

type MsgCreatePost = msgs.MsgCreatePost

type MsgEditPost

type MsgEditPost = msgs.MsgEditPost

type MsgRegisterReaction added in v0.4.0

type MsgRegisterReaction = msgs.MsgRegisterReaction

type MsgRemovePostReaction added in v0.2.0

type MsgRemovePostReaction = msgs.MsgRemovePostReaction

type OptionalData added in v0.2.0

type OptionalData = common.OptionalData

type PollAnswer added in v0.3.0

type PollAnswer = polls.PollAnswer

type PollAnswers added in v0.3.0

type PollAnswers = polls.PollAnswers

type PollAnswersQueryResponse added in v0.3.0

type PollAnswersQueryResponse = models.PollAnswersQueryResponse

type PollData added in v0.3.0

type PollData = polls.PollData

type Post

type Post = models.Post

type PostID

type PostID = models.PostID

type PostIDs

type PostIDs = models.PostIDs

type PostMedia added in v0.3.0

type PostMedia = common.PostMedia

type PostMedias added in v0.3.0

type PostMedias = common.PostMedias

type PostQueryResponse added in v0.2.0

type PostQueryResponse = models.PostQueryResponse

type PostReaction added in v0.4.0

type PostReaction = reactions.PostReaction

type PostReactions added in v0.4.0

type PostReactions = reactions.PostReactions

type Posts

type Posts = models.Posts

type QueryPostsParams added in v0.2.0

type QueryPostsParams struct {
	Page  int
	Limit int

	SortBy    string // Field that should determine the sorting
	SortOrder string // Either ascending or descending

	ParentID       *PostID
	CreationTime   *time.Time
	AllowsComments *bool
	Subspace       string
	Creator        sdk.AccAddress
	Hashtags       []string
}

QueryPostsParams Params for query 'custom/posts/posts'

func DefaultQueryPostsParams added in v0.2.0

func DefaultQueryPostsParams(page, limit int) QueryPostsParams

type Reaction added in v0.2.0

type Reaction = reactions.Reaction

type ReactionQueryResponse added in v0.4.0

type ReactionQueryResponse = models.ReactionQueryResponse

type Reactions added in v0.2.0

type Reactions = reactions.Reactions

type UserAnswer added in v0.3.0

type UserAnswer = polls.UserAnswer

type UserAnswers added in v0.3.0

type UserAnswers = polls.UserAnswers

Directories

Path Synopsis
nolint
nolint

Jump to

Keyboard shortcuts

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