Documentation ¶
Index ¶
- Variables
- func GetAuthorPrefix(author linotypes.AccountKey) []byte
- func GetConsumptionWindowKey() []byte
- func GetPostInfoKey(permlink linotypes.Permlink) []byte
- func NewPostDumper(store PostStorage) *testutils.Dumper
- type Post
- type PostIR
- type PostStorage
- func (ps PostStorage) GetConsumptionWindow(ctx sdk.Context) linotypes.MiniDollar
- func (ps PostStorage) GetPost(ctx sdk.Context, permlink linotypes.Permlink) (*Post, sdk.Error)
- func (ps PostStorage) HasPost(ctx sdk.Context, permlink linotypes.Permlink) bool
- func (ps PostStorage) PartialStoreMap(ctx sdk.Context) utils.StoreMap
- func (ps PostStorage) SetConsumptionWindow(ctx sdk.Context, consumption linotypes.MiniDollar)
- func (ps PostStorage) SetPost(ctx sdk.Context, postInfo *Post)
- type PostTablesIR
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PostSubStore = []byte{0x00} // SubStore for all post info ConsumptionWindowSubStore = []byte{0x01} // SubStore for consumption window. )
Functions ¶
func GetAuthorPrefix ¶ added in v0.3.0
func GetAuthorPrefix(author linotypes.AccountKey) []byte
func GetConsumptionWindowKey ¶ added in v0.6.0
func GetConsumptionWindowKey() []byte
GetConsumptionWindowKey - "consumption window substore"
func GetPostInfoKey ¶
GetPostInfoKey - "post info substore" + "permlink"
func NewPostDumper ¶ added in v0.4.0
func NewPostDumper(store PostStorage) *testutils.Dumper
Types ¶
type Post ¶ added in v0.3.0
type Post struct { PostID string `json:"post_id"` Title string `json:"title"` Content string `json:"content"` Author types.AccountKey `json:"author"` CreatedBy types.AccountKey `json:"created_by"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` IsDeleted bool `json:"is_deleted"` }
Post - post is created by the CreatedBy.
type PostIR ¶ added in v0.4.0
type PostIR struct { PostID string `json:"post_id"` Title string `json:"title"` Content string `json:"content"` Author types.AccountKey `json:"author"` CreatedBy types.AccountKey `json:"created_by"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` IsDeleted bool `json:"is_deleted"` }
PostIR - is the IR of Post.
type PostStorage ¶
type PostStorage struct {
// contains filtered or unexported fields
}
PostStorage - post storage
func NewPostStorage ¶
func NewPostStorage(key sdk.StoreKey) PostStorage
NewPostStorage - returns a new PostStorage that uses codec to (binary) encode and decode concrete Post
func (PostStorage) GetConsumptionWindow ¶ added in v0.6.0
func (ps PostStorage) GetConsumptionWindow(ctx sdk.Context) linotypes.MiniDollar
func (PostStorage) HasPost ¶ added in v0.3.0
DoesPostExist - check if a post exists in KVStore or not
func (PostStorage) PartialStoreMap ¶ added in v0.6.0
func (ps PostStorage) PartialStoreMap(ctx sdk.Context) utils.StoreMap
func (PostStorage) SetConsumptionWindow ¶ added in v0.6.0
func (ps PostStorage) SetConsumptionWindow(ctx sdk.Context, consumption linotypes.MiniDollar)
type PostTablesIR ¶ added in v0.2.0
type PostTablesIR struct { Version int `json:"version"` Posts []PostIR `json:"posts"` ConsumptionWindow types.MiniDollar `json:"consumption_window"` }
PostTablesIR - is the Post State.
Click to show internal directories.
Click to hide internal directories.