Documentation ¶
Index ¶
- Constants
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) GetDefaultSessionLength(ctx sdk.Context) int64
- func (k Keeper) GetLastSessionID(ctx sdk.Context) types.SessionID
- func (k Keeper) GetSession(ctx sdk.Context, id types.SessionID) (session types.Session, found bool)
- func (k Keeper) GetSessions(ctx sdk.Context) types.Sessions
- func (k Keeper) SaveSession(ctx sdk.Context, session types.Session)
- func (k Keeper) SetDefaultSessionLength(ctx sdk.Context, length int64) error
- func (k Keeper) SetLastSessionID(ctx sdk.Context, id types.SessionID)
Constants ¶
const (
QuerySessions = "sessions"
)
query endpoints supported by the magpie Querier
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler returns a handler for "magpie" type messages.
func NewQuerier ¶
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 (Keeper) GetDefaultSessionLength ¶ added in v0.3.0
GetDefaultSessionLength returns the default session length in number of blocks.
func (Keeper) GetLastSessionID ¶
GetLastLikeId returns the last like id that has been used
func (Keeper) GetSession ¶
GetSession returns the session having the specified id
func (Keeper) GetSessions ¶
GetSessions returns the list of all the sessions present inside the current context
func (Keeper) SaveSession ¶
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
SetDefaultSessionLength allows to set a default session length for new magpie sessions. The specified length is intended to be in number of blocks.