v4

package
v6.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthModels        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowModels          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupModels = fmt.Errorf("proto: unexpected end of group")
)
View Source
var PostReferenceType_name = map[int32]string{
	0: "POST_REFERENCE_TYPE_UNSPECIFIED",
	1: "POST_REFERENCE_TYPE_REPLY",
	2: "POST_REFERENCE_TYPE_QUOTE",
	3: "POST_REFERENCE_TYPE_REPOST",
}
View Source
var PostReferenceType_value = map[string]int32{
	"POST_REFERENCE_TYPE_UNSPECIFIED": 0,
	"POST_REFERENCE_TYPE_REPLY":       1,
	"POST_REFERENCE_TYPE_QUOTE":       2,
	"POST_REFERENCE_TYPE_REPOST":      3,
}
View Source
var ReplySetting_name = map[int32]string{
	0: "REPLY_SETTING_UNSPECIFIED",
	1: "REPLY_SETTING_EVERYONE",
	2: "REPLY_SETTING_FOLLOWERS",
	3: "REPLY_SETTING_MUTUAL",
	4: "REPLY_SETTING_MENTIONS",
}
View Source
var ReplySetting_value = map[string]int32{
	"REPLY_SETTING_UNSPECIFIED": 0,
	"REPLY_SETTING_EVERYONE":    1,
	"REPLY_SETTING_FOLLOWERS":   2,
	"REPLY_SETTING_MUTUAL":      3,
	"REPLY_SETTING_MENTIONS":    4,
}

Functions

func MigrateStore

func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, cdc codec.BinaryCodec) error

MigrateStore performs the migration from version 3 to version 4 of the store. To do this, it iterates over all the polls, and removes from the store the user answers for polls that are already ended (and thus should have not accepted new answers).

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

Types

type Attachment

type Attachment struct {
	// Id of the subspace inside which the post to which this attachment should be
	// connected is
	SubspaceID uint64 `protobuf:"varint,1,opt,name=subspace_id,json=subspaceId,proto3" json:"subspace_id,omitempty" yaml:"subspace_id"`
	// Id of the post to which this attachment should be connected
	PostID uint64 `protobuf:"varint,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty" yaml:"post_id"`
	// If of this attachment
	ID uint32 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty" yaml:"id"`
	// Content of the attachment
	Content *types.Any `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty" yaml:"content"`
}

Attachment contains the data of a single post attachment

func NewAttachment

func NewAttachment(subspaceID uint64, postID uint64, id uint32, content AttachmentContent) Attachment

NewAttachment returns a new Attachment instance

func (*Attachment) Descriptor

func (*Attachment) Descriptor() ([]byte, []int)

func (*Attachment) Equal

func (this *Attachment) Equal(that interface{}) bool

func (*Attachment) GetContent

func (m *Attachment) GetContent() *types.Any

func (*Attachment) GetID

func (m *Attachment) GetID() uint32

func (*Attachment) GetPostID

func (m *Attachment) GetPostID() uint64

func (*Attachment) GetSubspaceID

func (m *Attachment) GetSubspaceID() uint64

func (*Attachment) Marshal

func (m *Attachment) Marshal() (dAtA []byte, err error)

func (*Attachment) MarshalTo

func (m *Attachment) MarshalTo(dAtA []byte) (int, error)

func (*Attachment) MarshalToSizedBuffer

func (m *Attachment) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Attachment) ProtoMessage

func (*Attachment) ProtoMessage()

func (*Attachment) Reset

func (m *Attachment) Reset()

func (*Attachment) Size

func (m *Attachment) Size() (n int)

func (*Attachment) String

func (m *Attachment) String() string

func (*Attachment) Unmarshal

func (m *Attachment) Unmarshal(dAtA []byte) error

func (*Attachment) UnpackInterfaces

func (a *Attachment) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements codecUnpackInterfacesMessage

func (*Attachment) XXX_DiscardUnknown

func (m *Attachment) XXX_DiscardUnknown()

func (*Attachment) XXX_Marshal

func (m *Attachment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Attachment) XXX_Merge

func (m *Attachment) XXX_Merge(src proto.Message)

func (*Attachment) XXX_Size

func (m *Attachment) XXX_Size() int

func (*Attachment) XXX_Unmarshal

func (m *Attachment) XXX_Unmarshal(b []byte) error

type AttachmentContent

type AttachmentContent interface {
	proto.Message
	// contains filtered or unexported methods
}

AttachmentContent represents an attachment content

type Entities

type Entities struct {
	// Hashtags represent inside the post text
	Hashtags []TextTag `protobuf:"bytes,1,rep,name=hashtags,proto3" json:"hashtags" yaml:"hashtags"`
	// Mentions present inside the post text
	Mentions []TextTag `protobuf:"bytes,2,rep,name=mentions,proto3" json:"mentions" yaml:"mentions"`
	// Links present inside the post text
	Urls []Url `protobuf:"bytes,3,rep,name=urls,proto3" json:"urls" yaml:"urls"`
}

Contains the details of entities parsed out of the post text

func NewEntities

func NewEntities(hashtags []TextTag, mentions []TextTag, urls []Url) *Entities

NewEntities returns a new Entities instance

func (*Entities) Descriptor

func (*Entities) Descriptor() ([]byte, []int)

func (*Entities) Equal

func (this *Entities) Equal(that interface{}) bool

func (*Entities) GetHashtags

func (m *Entities) GetHashtags() []TextTag

func (*Entities) GetMentions

func (m *Entities) GetMentions() []TextTag

func (*Entities) GetUrls

func (m *Entities) GetUrls() []Url

func (*Entities) Marshal

func (m *Entities) Marshal() (dAtA []byte, err error)

func (*Entities) MarshalTo

func (m *Entities) MarshalTo(dAtA []byte) (int, error)

func (*Entities) MarshalToSizedBuffer

func (m *Entities) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Entities) ProtoMessage

func (*Entities) ProtoMessage()

func (*Entities) Reset

func (m *Entities) Reset()

func (*Entities) Size

func (m *Entities) Size() (n int)

func (*Entities) String

func (m *Entities) String() string

func (*Entities) Unmarshal

func (m *Entities) Unmarshal(dAtA []byte) error

func (*Entities) XXX_DiscardUnknown

func (m *Entities) XXX_DiscardUnknown()

func (*Entities) XXX_Marshal

func (m *Entities) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Entities) XXX_Merge

func (m *Entities) XXX_Merge(src proto.Message)

func (*Entities) XXX_Size

func (m *Entities) XXX_Size() int

func (*Entities) XXX_Unmarshal

func (m *Entities) XXX_Unmarshal(b []byte) error

type Media

type Media struct {
	Uri      string `protobuf:"bytes,2,opt,name=uri,proto3" json:"uri,omitempty" yaml:"uri"`
	MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty" yaml:"mime_type"`
}

Media represents a media attachment

func NewMedia

func NewMedia(uri, mimeType string) *Media

NewMedia returns a new Media instance

func (*Media) Descriptor

func (*Media) Descriptor() ([]byte, []int)

func (*Media) Equal

func (this *Media) Equal(that interface{}) bool

func (*Media) GetMimeType

func (m *Media) GetMimeType() string

func (*Media) GetUri

func (m *Media) GetUri() string

func (*Media) Marshal

func (m *Media) Marshal() (dAtA []byte, err error)

func (*Media) MarshalTo

func (m *Media) MarshalTo(dAtA []byte) (int, error)

func (*Media) MarshalToSizedBuffer

func (m *Media) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Media) ProtoMessage

func (*Media) ProtoMessage()

func (*Media) Reset

func (m *Media) Reset()

func (*Media) Size

func (m *Media) Size() (n int)

func (*Media) String

func (m *Media) String() string

func (*Media) Unmarshal

func (m *Media) Unmarshal(dAtA []byte) error

func (*Media) XXX_DiscardUnknown

func (m *Media) XXX_DiscardUnknown()

func (*Media) XXX_Marshal

func (m *Media) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Media) XXX_Merge

func (m *Media) XXX_Merge(src proto.Message)

func (*Media) XXX_Size

func (m *Media) XXX_Size() int

func (*Media) XXX_Unmarshal

func (m *Media) XXX_Unmarshal(b []byte) error

type Params

type Params struct {
	// Maximum length of the post text
	MaxTextLength uint32 `` /* 126-byte string literal not displayed */
}

Params contains the parameters for the posts module

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal

func (this *Params) Equal(that interface{}) bool

func (*Params) GetMaxTextLength

func (m *Params) GetMaxTextLength() uint32

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type Poll

type Poll struct {
	// Question of the poll
	Question string `protobuf:"bytes,1,opt,name=question,proto3" json:"question,omitempty" yaml:"question"`
	// Answers the users can choose from
	ProvidedAnswers []Poll_ProvidedAnswer `protobuf:"bytes,2,rep,name=provided_answers,json=providedAnswers,proto3" json:"provided_answers" yaml:"provided_answers"`
	// Date at which the poll will close
	EndDate time.Time `protobuf:"bytes,3,opt,name=end_date,json=endDate,proto3,stdtime" json:"end_date" yaml:"end_date"`
	// Whether the poll allows multiple choices from the same user or not
	AllowsMultipleAnswers bool `` /* 158-byte string literal not displayed */
	// Whether the poll allows to edit an answer or not
	AllowsAnswerEdits bool `` /* 143-byte string literal not displayed */
	// Final poll results
	FinalTallyResults *PollTallyResults `` /* 141-byte string literal not displayed */
}

Poll represents a poll attachment

func NewPoll

func NewPoll(
	question string,
	providedAnswers []Poll_ProvidedAnswer,
	endDate time.Time,
	allowsMultipleAnswers bool,
	allowsAnswerEdits bool,
	tallyResults *PollTallyResults,
) *Poll

NewPoll returns a new Poll instance

func (*Poll) Descriptor

func (*Poll) Descriptor() ([]byte, []int)

func (*Poll) Equal

func (this *Poll) Equal(that interface{}) bool

func (*Poll) GetAllowsAnswerEdits

func (m *Poll) GetAllowsAnswerEdits() bool

func (*Poll) GetAllowsMultipleAnswers

func (m *Poll) GetAllowsMultipleAnswers() bool

func (*Poll) GetEndDate

func (m *Poll) GetEndDate() time.Time

func (*Poll) GetFinalTallyResults

func (m *Poll) GetFinalTallyResults() *PollTallyResults

func (*Poll) GetProvidedAnswers

func (m *Poll) GetProvidedAnswers() []Poll_ProvidedAnswer

func (*Poll) GetQuestion

func (m *Poll) GetQuestion() string

func (*Poll) Marshal

func (m *Poll) Marshal() (dAtA []byte, err error)

func (*Poll) MarshalTo

func (m *Poll) MarshalTo(dAtA []byte) (int, error)

func (*Poll) MarshalToSizedBuffer

func (m *Poll) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Poll) ProtoMessage

func (*Poll) ProtoMessage()

func (*Poll) Reset

func (m *Poll) Reset()

func (*Poll) Size

func (m *Poll) Size() (n int)

func (*Poll) String

func (m *Poll) String() string

func (*Poll) Unmarshal

func (m *Poll) Unmarshal(dAtA []byte) error

func (*Poll) XXX_DiscardUnknown

func (m *Poll) XXX_DiscardUnknown()

func (*Poll) XXX_Marshal

func (m *Poll) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Poll) XXX_Merge

func (m *Poll) XXX_Merge(src proto.Message)

func (*Poll) XXX_Size

func (m *Poll) XXX_Size() int

func (*Poll) XXX_Unmarshal

func (m *Poll) XXX_Unmarshal(b []byte) error

type PollTallyResults

type PollTallyResults struct {
	Results []PollTallyResults_AnswerResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results" yaml:"results"`
}

PollTallyResults contains the tally results for a poll

func NewPollTallyResults

func NewPollTallyResults(results []PollTallyResults_AnswerResult) *PollTallyResults

NewPollTallyResults returns a new PollTallyResults instance

func (*PollTallyResults) Descriptor

func (*PollTallyResults) Descriptor() ([]byte, []int)

func (*PollTallyResults) Equal

func (this *PollTallyResults) Equal(that interface{}) bool

func (*PollTallyResults) GetResults

func (*PollTallyResults) Marshal

func (m *PollTallyResults) Marshal() (dAtA []byte, err error)

func (*PollTallyResults) MarshalTo

func (m *PollTallyResults) MarshalTo(dAtA []byte) (int, error)

func (*PollTallyResults) MarshalToSizedBuffer

func (m *PollTallyResults) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PollTallyResults) ProtoMessage

func (*PollTallyResults) ProtoMessage()

func (*PollTallyResults) Reset

func (m *PollTallyResults) Reset()

func (*PollTallyResults) Size

func (m *PollTallyResults) Size() (n int)

func (*PollTallyResults) String

func (m *PollTallyResults) String() string

func (*PollTallyResults) Unmarshal

func (m *PollTallyResults) Unmarshal(dAtA []byte) error

func (*PollTallyResults) XXX_DiscardUnknown

func (m *PollTallyResults) XXX_DiscardUnknown()

func (*PollTallyResults) XXX_Marshal

func (m *PollTallyResults) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PollTallyResults) XXX_Merge

func (m *PollTallyResults) XXX_Merge(src proto.Message)

func (*PollTallyResults) XXX_Size

func (m *PollTallyResults) XXX_Size() int

func (*PollTallyResults) XXX_Unmarshal

func (m *PollTallyResults) XXX_Unmarshal(b []byte) error

type PollTallyResults_AnswerResult

type PollTallyResults_AnswerResult struct {
	// Index of the answer inside the poll's ProvidedAnswers slice
	AnswerIndex uint32 `protobuf:"varint,1,opt,name=answer_index,json=answerIndex,proto3" json:"answer_index,omitempty" yaml:"answer_index"`
	// Number of votes the answer has received
	Votes uint64 `protobuf:"varint,2,opt,name=votes,proto3" json:"votes,omitempty" yaml:"votes"`
}

AnswerResult contains the result of a single poll provided answer

func NewAnswerResult

func NewAnswerResult(answerIndex uint32, votes uint64) PollTallyResults_AnswerResult

NewAnswerResult returns a new PollTallyResults_AnswerResult instance

func (*PollTallyResults_AnswerResult) Descriptor

func (*PollTallyResults_AnswerResult) Descriptor() ([]byte, []int)

func (*PollTallyResults_AnswerResult) Equal

func (this *PollTallyResults_AnswerResult) Equal(that interface{}) bool

func (*PollTallyResults_AnswerResult) GetAnswerIndex

func (m *PollTallyResults_AnswerResult) GetAnswerIndex() uint32

func (*PollTallyResults_AnswerResult) GetVotes

func (m *PollTallyResults_AnswerResult) GetVotes() uint64

func (*PollTallyResults_AnswerResult) Marshal

func (m *PollTallyResults_AnswerResult) Marshal() (dAtA []byte, err error)

func (*PollTallyResults_AnswerResult) MarshalTo

func (m *PollTallyResults_AnswerResult) MarshalTo(dAtA []byte) (int, error)

func (*PollTallyResults_AnswerResult) MarshalToSizedBuffer

func (m *PollTallyResults_AnswerResult) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PollTallyResults_AnswerResult) ProtoMessage

func (*PollTallyResults_AnswerResult) ProtoMessage()

func (*PollTallyResults_AnswerResult) Reset

func (m *PollTallyResults_AnswerResult) Reset()

func (*PollTallyResults_AnswerResult) Size

func (m *PollTallyResults_AnswerResult) Size() (n int)

func (*PollTallyResults_AnswerResult) String

func (*PollTallyResults_AnswerResult) Unmarshal

func (m *PollTallyResults_AnswerResult) Unmarshal(dAtA []byte) error

func (*PollTallyResults_AnswerResult) XXX_DiscardUnknown

func (m *PollTallyResults_AnswerResult) XXX_DiscardUnknown()

func (*PollTallyResults_AnswerResult) XXX_Marshal

func (m *PollTallyResults_AnswerResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PollTallyResults_AnswerResult) XXX_Merge

func (m *PollTallyResults_AnswerResult) XXX_Merge(src proto.Message)

func (*PollTallyResults_AnswerResult) XXX_Size

func (m *PollTallyResults_AnswerResult) XXX_Size() int

func (*PollTallyResults_AnswerResult) XXX_Unmarshal

func (m *PollTallyResults_AnswerResult) XXX_Unmarshal(b []byte) error

type Poll_ProvidedAnswer

type Poll_ProvidedAnswer struct {
	// (optional) Text of the answer
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty" yaml:"text"`
	// Attachments of the answer
	Attachments []Attachment `protobuf:"bytes,2,rep,name=attachments,proto3" json:"attachments" yaml:"attachments"`
}

Provided answer contains the details of a possible poll answer

func NewProvidedAnswer

func NewProvidedAnswer(text string, attachments []Attachment) Poll_ProvidedAnswer

NewProvidedAnswer returns a new Poll_ProvidedAnswer instance

func (*Poll_ProvidedAnswer) Descriptor

func (*Poll_ProvidedAnswer) Descriptor() ([]byte, []int)

func (*Poll_ProvidedAnswer) Equal

func (this *Poll_ProvidedAnswer) Equal(that interface{}) bool

func (*Poll_ProvidedAnswer) GetAttachments

func (m *Poll_ProvidedAnswer) GetAttachments() []Attachment

func (*Poll_ProvidedAnswer) GetText

func (m *Poll_ProvidedAnswer) GetText() string

func (*Poll_ProvidedAnswer) Marshal

func (m *Poll_ProvidedAnswer) Marshal() (dAtA []byte, err error)

func (*Poll_ProvidedAnswer) MarshalTo

func (m *Poll_ProvidedAnswer) MarshalTo(dAtA []byte) (int, error)

func (*Poll_ProvidedAnswer) MarshalToSizedBuffer

func (m *Poll_ProvidedAnswer) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Poll_ProvidedAnswer) ProtoMessage

func (*Poll_ProvidedAnswer) ProtoMessage()

func (*Poll_ProvidedAnswer) Reset

func (m *Poll_ProvidedAnswer) Reset()

func (*Poll_ProvidedAnswer) Size

func (m *Poll_ProvidedAnswer) Size() (n int)

func (*Poll_ProvidedAnswer) String

func (m *Poll_ProvidedAnswer) String() string

func (*Poll_ProvidedAnswer) Unmarshal

func (m *Poll_ProvidedAnswer) Unmarshal(dAtA []byte) error

func (*Poll_ProvidedAnswer) XXX_DiscardUnknown

func (m *Poll_ProvidedAnswer) XXX_DiscardUnknown()

func (*Poll_ProvidedAnswer) XXX_Marshal

func (m *Poll_ProvidedAnswer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Poll_ProvidedAnswer) XXX_Merge

func (m *Poll_ProvidedAnswer) XXX_Merge(src proto.Message)

func (*Poll_ProvidedAnswer) XXX_Size

func (m *Poll_ProvidedAnswer) XXX_Size() int

func (*Poll_ProvidedAnswer) XXX_Unmarshal

func (m *Poll_ProvidedAnswer) XXX_Unmarshal(b []byte) error

type Post

type Post struct {
	// Id of the subspace inside which the post has been created
	SubspaceID uint64 `protobuf:"varint,1,opt,name=subspace_id,json=subspaceId,proto3" json:"subspace_id,omitempty" yaml:"subspace_id"`
	// Id of the section inside which the post has been created
	SectionID uint32 `protobuf:"varint,2,opt,name=section_id,json=sectionId,proto3" json:"section_id,omitempty" yaml:"section_id"`
	// Unique id of the post
	ID uint64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty" yaml:"id"`
	// (optional) External id for this post
	ExternalID string `protobuf:"bytes,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty" yaml:"external_id"`
	// (optional) Text of the post
	Text string `protobuf:"bytes,5,opt,name=text,proto3" json:"text,omitempty" yaml:"text"`
	// (optional) Entities connected to this post
	Entities *Entities `protobuf:"bytes,6,opt,name=entities,proto3" json:"entities,omitempty" yaml:"entities"`
	// Tags related to this post, useful for categorization
	Tags []string `protobuf:"bytes,7,rep,name=tags,proto3" json:"tags,omitempty" yaml:"tags"`
	// Author of the post
	Author string `protobuf:"bytes,8,opt,name=author,proto3" json:"author,omitempty" yaml:"author"`
	// (optional) Id of the original post of the conversation
	ConversationID uint64 `` /* 127-byte string literal not displayed */
	// A list this posts references (either as a reply, repost or quote)
	ReferencedPosts []PostReference `protobuf:"bytes,10,rep,name=referenced_posts,json=referencedPosts,proto3" json:"referenced_posts" yaml:"referenced_posts"`
	// Reply settings of this post
	ReplySettings ReplySetting `` /* 158-byte string literal not displayed */
	// Creation date of the post
	CreationDate time.Time `protobuf:"bytes,12,opt,name=creation_date,json=creationDate,proto3,stdtime" json:"creation_date" yaml:"creation_date"`
	// (optional) Last edited time of the post
	LastEditedDate *time.Time `` /* 138-byte string literal not displayed */
}

Post contains all the information about a single post

func NewPost

func NewPost(
	subspaceID uint64,
	sectionID uint32,
	id uint64,
	externalID string,
	text string,
	author string,
	conversationID uint64,
	entities *Entities,
	tags []string,
	referencedPosts []PostReference,
	replySetting ReplySetting,
	creationDate time.Time,
	lastEditedDate *time.Time,
) Post

NewPost allows to build a new Post instance

func (*Post) Descriptor

func (*Post) Descriptor() ([]byte, []int)

func (*Post) Equal

func (this *Post) Equal(that interface{}) bool

func (*Post) GetAuthor

func (m *Post) GetAuthor() string

func (*Post) GetConversationID

func (m *Post) GetConversationID() uint64

func (*Post) GetCreationDate

func (m *Post) GetCreationDate() time.Time

func (*Post) GetEntities

func (m *Post) GetEntities() *Entities

func (*Post) GetExternalID

func (m *Post) GetExternalID() string

func (*Post) GetID

func (m *Post) GetID() uint64

func (*Post) GetLastEditedDate

func (m *Post) GetLastEditedDate() *time.Time

func (*Post) GetReferencedPosts

func (m *Post) GetReferencedPosts() []PostReference

func (*Post) GetReplySettings

func (m *Post) GetReplySettings() ReplySetting

func (*Post) GetSectionID

func (m *Post) GetSectionID() uint32

func (*Post) GetSubspaceID

func (m *Post) GetSubspaceID() uint64

func (*Post) GetTags

func (m *Post) GetTags() []string

func (*Post) GetText

func (m *Post) GetText() string

func (*Post) Marshal

func (m *Post) Marshal() (dAtA []byte, err error)

func (*Post) MarshalTo

func (m *Post) MarshalTo(dAtA []byte) (int, error)

func (*Post) MarshalToSizedBuffer

func (m *Post) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Post) ProtoMessage

func (*Post) ProtoMessage()

func (*Post) Reset

func (m *Post) Reset()

func (*Post) Size

func (m *Post) Size() (n int)

func (*Post) String

func (m *Post) String() string

func (*Post) Unmarshal

func (m *Post) Unmarshal(dAtA []byte) error

func (*Post) XXX_DiscardUnknown

func (m *Post) XXX_DiscardUnknown()

func (*Post) XXX_Marshal

func (m *Post) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Post) XXX_Merge

func (m *Post) XXX_Merge(src proto.Message)

func (*Post) XXX_Size

func (m *Post) XXX_Size() int

func (*Post) XXX_Unmarshal

func (m *Post) XXX_Unmarshal(b []byte) error

type PostReference

type PostReference struct {
	// Type of reference
	Type PostReferenceType `protobuf:"varint,1,opt,name=type,proto3,enum=desmos.posts.v2.PostReferenceType" json:"type,omitempty" yaml:"type"`
	// Id of the referenced post
	PostID uint64 `protobuf:"varint,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty" yaml:"post_id"`
	// Position of the reference inside the post's text. This should be used only
	// with the type set to TYPE_QUOTE
	Position uint64 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty" yaml:"position"`
}

PostReference contains the details of a post reference

func NewPostReference

func NewPostReference(referenceType PostReferenceType, postID uint64, position uint64) PostReference

NewPostReference returns a new PostReference instance

func (*PostReference) Descriptor

func (*PostReference) Descriptor() ([]byte, []int)

func (*PostReference) Equal

func (this *PostReference) Equal(that interface{}) bool

func (*PostReference) GetPosition

func (m *PostReference) GetPosition() uint64

func (*PostReference) GetPostID

func (m *PostReference) GetPostID() uint64

func (*PostReference) GetType

func (m *PostReference) GetType() PostReferenceType

func (*PostReference) Marshal

func (m *PostReference) Marshal() (dAtA []byte, err error)

func (*PostReference) MarshalTo

func (m *PostReference) MarshalTo(dAtA []byte) (int, error)

func (*PostReference) MarshalToSizedBuffer

func (m *PostReference) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PostReference) ProtoMessage

func (*PostReference) ProtoMessage()

func (*PostReference) Reset

func (m *PostReference) Reset()

func (*PostReference) Size

func (m *PostReference) Size() (n int)

func (*PostReference) String

func (m *PostReference) String() string

func (*PostReference) Unmarshal

func (m *PostReference) Unmarshal(dAtA []byte) error

func (*PostReference) XXX_DiscardUnknown

func (m *PostReference) XXX_DiscardUnknown()

func (*PostReference) XXX_Marshal

func (m *PostReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PostReference) XXX_Merge

func (m *PostReference) XXX_Merge(src proto.Message)

func (*PostReference) XXX_Size

func (m *PostReference) XXX_Size() int

func (*PostReference) XXX_Unmarshal

func (m *PostReference) XXX_Unmarshal(b []byte) error

type PostReferenceType

type PostReferenceType int32

PostReferenceType represents the different types of references

const (
	// No reference specified
	POST_REFERENCE_TYPE_UNSPECIFIED PostReferenceType = 0
	// This reference represents a reply to the specified post
	POST_REFERENCE_TYPE_REPLY PostReferenceType = 1
	// This reference represents a quote of the specified post
	POST_REFERENCE_TYPE_QUOTE PostReferenceType = 2
	// This reference represents a repost of the specified post
	POST_REFERENCE_TYPE_REPOST PostReferenceType = 3
)

func (PostReferenceType) EnumDescriptor

func (PostReferenceType) EnumDescriptor() ([]byte, []int)

func (PostReferenceType) String

func (x PostReferenceType) String() string

type ReplySetting

type ReplySetting int32

ReplySetting contains the possible reply settings that a post can have

const (
	// No reply setting specified
	REPLY_SETTING_UNSPECIFIED ReplySetting = 0
	// Everyone will be able to reply to this post
	REPLY_SETTING_EVERYONE ReplySetting = 1
	// Only followers of the author will be able to reply to this post
	REPLY_SETTING_FOLLOWERS ReplySetting = 2
	// Only the author mutual followers will be able to reply to this post
	REPLY_SETTING_MUTUAL ReplySetting = 3
	// Only people mentioned inside this post will be able to reply
	REPLY_SETTING_MENTIONS ReplySetting = 4
)

func (ReplySetting) EnumDescriptor

func (ReplySetting) EnumDescriptor() ([]byte, []int)

func (ReplySetting) String

func (x ReplySetting) String() string

type TextTag

type TextTag struct {
	// Index of the character inside the text at which the tag starts
	Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty" yaml:"start"`
	// Index of the character inside the text at which the tag ends
	End uint64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty" yaml:"end"`
	// Tag reference (user address, hashtag value, etc)
	Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty" yaml:"tag"`
}

TextTag represents a tag within the post text

func NewTextTag

func NewTextTag(start, end uint64, tag string) TextTag

NewTextTag returns a new TextTag instance

func (*TextTag) Descriptor

func (*TextTag) Descriptor() ([]byte, []int)

func (*TextTag) Equal

func (this *TextTag) Equal(that interface{}) bool

func (*TextTag) GetEnd

func (m *TextTag) GetEnd() uint64

func (*TextTag) GetStart

func (m *TextTag) GetStart() uint64

func (*TextTag) GetTag

func (m *TextTag) GetTag() string

func (*TextTag) Marshal

func (m *TextTag) Marshal() (dAtA []byte, err error)

func (*TextTag) MarshalTo

func (m *TextTag) MarshalTo(dAtA []byte) (int, error)

func (*TextTag) MarshalToSizedBuffer

func (m *TextTag) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TextTag) ProtoMessage

func (*TextTag) ProtoMessage()

func (*TextTag) Reset

func (m *TextTag) Reset()

func (*TextTag) Size

func (m *TextTag) Size() (n int)

func (*TextTag) String

func (m *TextTag) String() string

func (*TextTag) Unmarshal

func (m *TextTag) Unmarshal(dAtA []byte) error

func (*TextTag) XXX_DiscardUnknown

func (m *TextTag) XXX_DiscardUnknown()

func (*TextTag) XXX_Marshal

func (m *TextTag) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TextTag) XXX_Merge

func (m *TextTag) XXX_Merge(src proto.Message)

func (*TextTag) XXX_Size

func (m *TextTag) XXX_Size() int

func (*TextTag) XXX_Unmarshal

func (m *TextTag) XXX_Unmarshal(b []byte) error

type Url

type Url struct {
	// Index of the character inside the text at which the URL starts
	Start uint64 `protobuf:"varint,1,opt,name=start,proto3" json:"start,omitempty" yaml:"start"`
	// Index of the character inside the text at which the URL ends
	End uint64 `protobuf:"varint,2,opt,name=end,proto3" json:"end,omitempty" yaml:"end"`
	// Value of the URL where the user should be redirected to
	Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty" yaml:"url"`
	// (optional) Display value of the URL
	DisplayUrl string `protobuf:"bytes,4,opt,name=display_url,json=displayUrl,proto3" json:"display_url,omitempty" yaml:"display_url"`
}

Url contains the details of a generic URL

func NewURL

func NewURL(start, end uint64, url, displayURL string) Url

NewURL returns a new Url instance

func (*Url) Descriptor

func (*Url) Descriptor() ([]byte, []int)

func (*Url) Equal

func (this *Url) Equal(that interface{}) bool

func (*Url) GetDisplayUrl

func (m *Url) GetDisplayUrl() string

func (*Url) GetEnd

func (m *Url) GetEnd() uint64

func (*Url) GetStart

func (m *Url) GetStart() uint64

func (*Url) GetUrl

func (m *Url) GetUrl() string

func (*Url) Marshal

func (m *Url) Marshal() (dAtA []byte, err error)

func (*Url) MarshalTo

func (m *Url) MarshalTo(dAtA []byte) (int, error)

func (*Url) MarshalToSizedBuffer

func (m *Url) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Url) ProtoMessage

func (*Url) ProtoMessage()

func (*Url) Reset

func (m *Url) Reset()

func (*Url) Size

func (m *Url) Size() (n int)

func (*Url) String

func (m *Url) String() string

func (*Url) Unmarshal

func (m *Url) Unmarshal(dAtA []byte) error

func (*Url) XXX_DiscardUnknown

func (m *Url) XXX_DiscardUnknown()

func (*Url) XXX_Marshal

func (m *Url) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Url) XXX_Merge

func (m *Url) XXX_Merge(src proto.Message)

func (*Url) XXX_Size

func (m *Url) XXX_Size() int

func (*Url) XXX_Unmarshal

func (m *Url) XXX_Unmarshal(b []byte) error

type UserAnswer

type UserAnswer struct {
	// Subspace id inside which the post related to this attachment is located
	SubspaceID uint64 `protobuf:"varint,1,opt,name=subspace_id,json=subspaceId,proto3" json:"subspace_id,omitempty" yaml:"subspace_id"`
	// Id of the post associated to this attachment
	PostID uint64 `protobuf:"varint,2,opt,name=post_id,json=postId,proto3" json:"post_id,omitempty" yaml:"post_id"`
	// Id of the poll to which this answer is associated
	PollID uint32 `protobuf:"varint,3,opt,name=poll_id,json=pollId,proto3" json:"poll_id,omitempty" yaml:"poll_id"`
	// Indexes of the answers inside the ProvidedAnswers array
	AnswersIndexes []uint32 `` /* 134-byte string literal not displayed */
	// Address of the user answering the poll
	User string `protobuf:"bytes,5,opt,name=user,proto3" json:"user,omitempty" yaml:"user"`
}

UserAnswer represents a user answer to a poll

func NewUserAnswer

func NewUserAnswer(subspaceID uint64, postID uint64, pollID uint32, answersIndexes []uint32, user string) UserAnswer

NewUserAnswer returns a new UserAnswer instance

func (*UserAnswer) Descriptor

func (*UserAnswer) Descriptor() ([]byte, []int)

func (*UserAnswer) Equal

func (this *UserAnswer) Equal(that interface{}) bool

func (*UserAnswer) GetAnswersIndexes

func (m *UserAnswer) GetAnswersIndexes() []uint32

func (*UserAnswer) GetPollID

func (m *UserAnswer) GetPollID() uint32

func (*UserAnswer) GetPostID

func (m *UserAnswer) GetPostID() uint64

func (*UserAnswer) GetSubspaceID

func (m *UserAnswer) GetSubspaceID() uint64

func (*UserAnswer) GetUser

func (m *UserAnswer) GetUser() string

func (*UserAnswer) Marshal

func (m *UserAnswer) Marshal() (dAtA []byte, err error)

func (*UserAnswer) MarshalTo

func (m *UserAnswer) MarshalTo(dAtA []byte) (int, error)

func (*UserAnswer) MarshalToSizedBuffer

func (m *UserAnswer) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*UserAnswer) ProtoMessage

func (*UserAnswer) ProtoMessage()

func (*UserAnswer) Reset

func (m *UserAnswer) Reset()

func (*UserAnswer) Size

func (m *UserAnswer) Size() (n int)

func (*UserAnswer) String

func (m *UserAnswer) String() string

func (*UserAnswer) Unmarshal

func (m *UserAnswer) Unmarshal(dAtA []byte) error

func (*UserAnswer) XXX_DiscardUnknown

func (m *UserAnswer) XXX_DiscardUnknown()

func (*UserAnswer) XXX_Marshal

func (m *UserAnswer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UserAnswer) XXX_Merge

func (m *UserAnswer) XXX_Merge(src proto.Message)

func (*UserAnswer) XXX_Size

func (m *UserAnswer) XXX_Size() int

func (*UserAnswer) XXX_Unmarshal

func (m *UserAnswer) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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