types

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = ModuleName

	MemberDoesNotExist sdk.CodeType = 101
)

DefaultCodespace is the Module Name

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "daemon"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// StoreKey to be used when creating the KVStore
	TStoreKey = "T_" + ModuleName
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file

RouterKey is the module name router key

Variables

View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

View Source
var (
	NilMember = Member{}
)

Functions

func ErrMemberDoesNotExist

func ErrMemberDoesNotExist(codespace sdk.CodespaceType) sdk.Error

ErrMemberDoesNotExist is the error for name not existing

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type DaemonMsg

type DaemonMsg interface {
	sdk.Msg
	SetOwner(owner sdk.AccAddress)
}

type Member

type Member struct {
	NodeID    string         `json:"nodeid"`
	Name      string         `json:"name"`
	Heartbeat time.Time      `json:"heartbeat"`
	Owner     sdk.AccAddress `json:"owner"`
	// contains filtered or unexported fields
}

Member member info

func NewMember

func NewMember(name string, nodeid string, owner sdk.AccAddress) Member

func (*Member) IsAlive

func (m *Member) IsAlive() bool

IsAlive return whether member is alive

func (*Member) IsLeader

func (m *Member) IsLeader() bool

IsLeader return whether member is leader

func (*Member) IsLocal

func (m *Member) IsLocal() bool

IsLocal return whether member is alive

func (*Member) SetAlive

func (m *Member) SetAlive(alive bool)

SetAlive Set member alive

func (*Member) SetLeader

func (m *Member) SetLeader(leader bool)

SetLeader Set member as leader

func (*Member) SetLocal

func (m *Member) SetLocal(local bool)

SetLocal Set member alive

func (Member) String

func (m Member) String() string

String implement fmt.Stringer

type MsgAddMember

type MsgAddMember struct {
	Name   string
	NodeID string
	Owner  sdk.AccAddress
}

MsgAddMember add member message

func NewMsgAddMember

func NewMsgAddMember(name string, nodeid string) MsgAddMember

func (MsgAddMember) GetSignBytes

func (msg MsgAddMember) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgAddMember) GetSigners

func (msg MsgAddMember) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgAddMember) Route

func (msg MsgAddMember) Route() string

Route should return the name of the module

func (MsgAddMember) SetOwner

func (msg MsgAddMember) SetOwner(owner sdk.AccAddress)

func (MsgAddMember) Type

func (msg MsgAddMember) Type() string

Type should return the action

func (MsgAddMember) ValidateBasic

func (msg MsgAddMember) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgHeartbeat

type MsgHeartbeat struct {
	NodeID string
	Time   time.Time
	Owner  sdk.AccAddress
}

MsgHeartbeat heartbeat message

func NewMsgHeartbeat

func NewMsgHeartbeat(nodeid string, time time.Time, owner sdk.AccAddress) MsgHeartbeat

func (MsgHeartbeat) GetSignBytes

func (msg MsgHeartbeat) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgHeartbeat) GetSigners

func (msg MsgHeartbeat) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgHeartbeat) Route

func (msg MsgHeartbeat) Route() string

Route should return the name of the module

func (MsgHeartbeat) SetOwner

func (msg MsgHeartbeat) SetOwner(owner sdk.AccAddress)

func (MsgHeartbeat) Type

func (msg MsgHeartbeat) Type() string

Type should return the action

func (MsgHeartbeat) ValidateBasic

func (msg MsgHeartbeat) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgRemoveMember

type MsgRemoveMember struct {
	NodeID string
	Owner  sdk.AccAddress
}

MsgRemoveMember remove member message

func NewMsgRemoveMember

func NewMsgRemoveMember(nodeid string) MsgRemoveMember

func (MsgRemoveMember) GetSignBytes

func (msg MsgRemoveMember) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgRemoveMember) GetSigners

func (msg MsgRemoveMember) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgRemoveMember) Route

func (msg MsgRemoveMember) Route() string

Route should return the name of the module

func (MsgRemoveMember) SetOwner

func (msg MsgRemoveMember) SetOwner(owner sdk.AccAddress)

func (MsgRemoveMember) Type

func (msg MsgRemoveMember) Type() string

Type should return the action

func (MsgRemoveMember) ValidateBasic

func (msg MsgRemoveMember) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type QueryResMember

type QueryResMember struct {
	NodeID string `json:"nodeid"`
	Name   string `json:"name"`
}

QueryMember Queries Result Payload for a member

func (QueryResMember) String

func (r QueryResMember) String() string

implement fmt.Stringer

type QueryResNodeIDs

type QueryResNodeIDs []string

QueryMembers Queries Result Payload for member ids query

func (QueryResNodeIDs) String

func (n QueryResNodeIDs) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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