keeper

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QuerySessions = "sessions"
)

query endpoints supported by the magpie Querier

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "magpie" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

type Keeper struct {
	StoreKey sdk.StoreKey // Unexposed key to access store from sdk.Context
	Cdc      *codec.Codec // The wire codec for binary encoding/decoding.
}

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) Keeper

NewKeeper creates new instances of the magpie Keeper

func (Keeper) GetDefaultSessionLength added in v0.3.0

func (k Keeper) GetDefaultSessionLength(ctx sdk.Context) int64

GetDefaultSessionLength returns the default session length in number of blocks.

func (Keeper) GetLastSessionID

func (k Keeper) GetLastSessionID(ctx sdk.Context) types.SessionID

GetLastLikeId returns the last like id that has been used

func (Keeper) GetSession

func (k Keeper) GetSession(ctx sdk.Context, id types.SessionID) (session types.Session, found bool)

GetSession returns the session having the specified id

func (Keeper) GetSessions

func (k Keeper) GetSessions(ctx sdk.Context) types.Sessions

GetSessions returns the list of all the sessions present inside the current context

func (Keeper) SaveSession

func (k Keeper) SaveSession(ctx sdk.Context, session types.Session)

SaveSession allows to save a session inside the given context. It assumes the given session has already been validated.

func (Keeper) SetDefaultSessionLength added in v0.3.0

func (k Keeper) SetDefaultSessionLength(ctx sdk.Context, length int64) error

SetDefaultSessionLength allows to set a default session length for new magpie sessions. The specified length is intended to be in number of blocks.

func (Keeper) SetLastSessionID

func (k Keeper) SetLastSessionID(ctx sdk.Context, id types.SessionID)

SetLastSessionID allows to set the last used like id

Jump to

Keyboard shortcuts

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