keeper

package
v0.0.0-...-fa6a018 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryMember  = "member"
	QueryNodeIDs = "nodeids"
)

query endpoints supported by the nameservice Querier

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

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

Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

NewKeeper creates new instances of the daemon Keeper

func (Keeper) GetHeartbeat

func (k Keeper) GetHeartbeat(ctx sdk.Context, nodeid string) time.Time

GetHeartbeat - get the current owner of a name

func (Keeper) GetMember

func (k Keeper) GetMember(ctx sdk.Context, nodeid string) (types.Member, error)

Gets the entire Member metadata struct for a name

func (Keeper) GetMembersIterator

func (k Keeper) GetMembersIterator(ctx sdk.Context) sdk.Iterator

Get an iterator over all names in which the keys are the nodeids and the values are the Members

func (Keeper) GetOwner

func (k Keeper) GetOwner(ctx sdk.Context, nodeid string) sdk.AccAddress

GetOwner - get the current owner of a name

func (Keeper) HasOwner

func (k Keeper) HasOwner(ctx sdk.Context, nodeid string) bool

HasOwner - returns whether or not the name already has an owner

func (Keeper) IsNodePresent

func (k Keeper) IsNodePresent(ctx sdk.Context, nodeid string) bool

Check if the node id is present in the store or not

func (Keeper) RemoveMember

func (k Keeper) RemoveMember(ctx sdk.Context, nodeid string)

Deletes the entire Member metadata struct for a name

func (Keeper) SetHeartbeat

func (k Keeper) SetHeartbeat(ctx sdk.Context, nodeid string, heartbeat time.Time)

SetHeartbeat - sets the current owner of a name

func (Keeper) SetMember

func (k Keeper) SetMember(ctx sdk.Context, nodeid string, member types.Member)

Sets the entire Member metadata struct for a name

func (Keeper) SetOwner

func (k Keeper) SetOwner(ctx sdk.Context, nodeid string, owner sdk.AccAddress)

SetOwner - sets the current owner of a name

Jump to

Keyboard shortcuts

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