civicliker

package
v0.0.0-...-d0e4e46 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryLikeCount   = "like-count"
	QueryLikeHistory = "like-history"
)

Variables

View Source
var (
	ModuleName   = types.ModuleName
	StoreKey     = types.StoreKey
	RouterKey    = types.RouterKey
	QuerierRoute = types.QuerierRoute

	RegisterCodec = types.RegisterCodec
)
View Source
var (
	LikeGlobalCountKey = []byte{0x00}
	LikeRecordKey      = []byte{0x10}
	LikeRecordCountKey = []byte{0x11}
	LikerStateKey      = []byte{0x20}
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, keeper Keeper)

func GetLikeRecordCountKey

func GetLikeRecordCountKey(liker sdk.AccAddress, url string) []byte

func GetLikerStateKey

func GetLikerStateKey(liker sdk.AccAddress) []byte

func GetPaymentHook

func GetPaymentHook(keeper Keeper) func(sdk.Context, *subTypes.Subscription, subTypes.Channel)

func NewHandler

func NewHandler(k Keeper) sdk.Handler

func NewQuerier

func NewQuerier(k Keeper, cdc *codec.Codec) sdk.Querier

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	coinKeeper bank.Keeper, subscriptionKeeper SubscriptionKeeper, storeKey sdk.StoreKey, cdc *codec.Codec,
) Keeper

func (Keeper) GetBlockLikeRecordsCache

func (k Keeper) GetBlockLikeRecordsCache() LikeRecordsCache

func (Keeper) GetLikeGlobalCount

func (k Keeper) GetLikeGlobalCount(ctx sdk.Context) uint64

func (Keeper) GetLikeRecordCount

func (k Keeper) GetLikeRecordCount(ctx sdk.Context, liker sdk.AccAddress, url string) uint64

func (Keeper) GetLikerState

func (k Keeper) GetLikerState(ctx sdk.Context, liker sdk.AccAddress) types.LikerState

func (Keeper) HasLikerState

func (k Keeper) HasLikerState(ctx sdk.Context, liker sdk.AccAddress) bool

func (Keeper) IterateLikerLikeHistory

func (k Keeper) IterateLikerLikeHistory(ctx sdk.Context, liker sdk.AccAddress,
	fn func(index int64, r types.LikeRecord) (stop bool))

func (Keeper) SetLikeGlobalCount

func (k Keeper) SetLikeGlobalCount(ctx sdk.Context, count uint64)

func (Keeper) SetLikeRecord

func (k Keeper) SetLikeRecord(ctx sdk.Context, r types.LikeRecord)

func (Keeper) SetLikeRecordCount

func (k Keeper) SetLikeRecordCount(ctx sdk.Context, liker sdk.AccAddress, url string, count uint64)

func (Keeper) SetLikerState

func (k Keeper) SetLikerState(ctx sdk.Context, s types.LikerState)

type LikeHistory

type LikeHistory []types.LikeRecord

func (LikeHistory) Len

func (h LikeHistory) Len() int

func (LikeHistory) Less

func (h LikeHistory) Less(i, j int) bool

func (LikeHistory) Swap

func (h LikeHistory) Swap(i, j int)

type LikeRecordsCache

type LikeRecordsCache map[string][]types.LikeRecord // key: likers

type QueryLikeCountParams

type QueryLikeCountParams struct {
	Liker sdk.AccAddress `json:"liker"`
	Url   string         `json:"url"`
}

type QueryLikeHistoryParams

type QueryLikeHistoryParams struct {
	Liker sdk.AccAddress `json:"liker"`
	Url   string         `json:"url"`
}

type SubscriptionKeeper

type SubscriptionKeeper interface {
	GetChannel(ctx sdk.Context, channelID uint64) subTypes.Channel
	GetSubscription(ctx sdk.Context, subscriber sdk.AccAddress, channelID uint64) subTypes.Subscription
	SetSubscription(ctx sdk.Context, sub subTypes.Subscription)
}

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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