Documentation
¶
Index ¶
- Constants
- func NewQuerier(keeper Keeper) sdk.Querier
- type Interval
- type Keeper
- func (k Keeper) CreatePost(ctx sdk.Context, p types.Post)
- func (k Keeper) DeletePost(ctx sdk.Context, owner sdk.AccAddress, id uuid.UUID)
- func (k Keeper) GetLikeByKey(ctx sdk.Context, key []byte) types.Like
- func (k Keeper) GetLikesIterator(ctx sdk.Context) sdk.Iterator
- func (k *Keeper) GetModerators(ctx sdk.Context) []string
- func (k Keeper) GetPopularPosts(ctx sdk.Context, interval Interval, c types.Category, from []byte, ...) []types.Post
- func (k Keeper) GetPostByKey(ctx sdk.Context, key []byte) types.Post
- func (k Keeper) GetPostsIterator(ctx sdk.Context) sdk.Iterator
- func (k Keeper) GetRecentPosts(ctx sdk.Context, c types.Category, from []byte, limit uint32) []types.Post
- func (k Keeper) GetUserLikedPosts(ctx sdk.Context, owner sdk.AccAddress) map[string]types.LikeWeight
- func (k Keeper) ListUserPosts(ctx sdk.Context, owner sdk.AccAddress, from uuid.UUID, limit uint32) []types.Post
- func (k Keeper) SetLike(ctx sdk.Context, newLike types.Like)
- func (k *Keeper) SetModerators(ctx sdk.Context, moderators []string)
- func (k Keeper) SyncIndex(ctx sdk.Context)
- type Post
- type TokenKeeper
Constants ¶
View Source
const ( QueryPopular = "popular" QueryPosts = "posts" QueryPost = "post" QueryUser = "user" QueryLikedPosts = "liked-posts" QueryModeratorAddr = "moderator-addr" QueryModerators = "moderators" )
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier creates a new querier for community clients.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, storeKey sdk.StoreKey, paramSpace params.Subspace, tokens TokenKeeper) Keeper
NewKeeper creates new instances of the community Keeper
func (Keeper) CreatePost ¶
CreatePost creates new post. Keeper's key is joined owner and uuid.
func (Keeper) DeletePost ¶
DeletePost deletes the post from keeper.
func (Keeper) GetLikeByKey ¶
GetLikeByKey returns entire like by keeper's key.
func (Keeper) GetLikesIterator ¶
GetLikesIterator returns an iterator over all likes
func (*Keeper) GetModerators ¶ added in v1.0.0
GetModerators returns the current moderators
func (Keeper) GetPopularPosts ¶ added in v0.5.3
func (Keeper) GetPostByKey ¶
GetPostByKey returns entire post by keeper's key.
func (Keeper) GetPostsIterator ¶
GetPostsIterator returns an iterator over all posts
func (Keeper) GetRecentPosts ¶ added in v0.5.3
func (Keeper) GetUserLikedPosts ¶ added in v0.5.3
func (k Keeper) GetUserLikedPosts(ctx sdk.Context, owner sdk.AccAddress) map[string]types.LikeWeight
func (Keeper) ListUserPosts ¶
func (*Keeper) SetModerators ¶ added in v1.0.0
SetModerators sets the moderators
type Post ¶
type Post struct { UUID string `json:"uuid"` Owner sdk.AccAddress `json:"owner"` Title string `json:"title"` PreviewImage string `json:"previewImage"` Category types.Category `json:"category"` Text string `json:"text"` LikesCount uint32 `json:"likesCount"` DislikesCount uint32 `json:"dislikesCount"` CreatedAt uint64 `json:"createdAt"` PDV float64 `json:"pdv" amino:"unsafe"` }
type TokenKeeper ¶
Click to show internal directories.
Click to hide internal directories.