Documentation ¶
Index ¶
- type HeartbeatDbStorer
- func (hs *HeartbeatDbStorer) IsInterfaceNil() bool
- func (hs *HeartbeatDbStorer) LoadGenesisTime() (time.Time, error)
- func (hs *HeartbeatDbStorer) LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error)
- func (hs *HeartbeatDbStorer) LoadKeys() ([][]byte, error)
- func (hs *HeartbeatDbStorer) SaveKeys(peersSlice [][]byte) error
- func (hs *HeartbeatDbStorer) SavePubkeyData(pubkey []byte, heartbeat *data.HeartbeatDTO) error
- func (hs *HeartbeatDbStorer) UpdateGenesisTime(genesisTime time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeartbeatDbStorer ¶
type HeartbeatDbStorer struct {
// contains filtered or unexported fields
}
HeartbeatDbStorer is the struct which will handle storage operations for heartbeat
func NewHeartbeatDbStorer ¶
func NewHeartbeatDbStorer( storer storage.Storer, marshalizer marshal.Marshalizer, ) (*HeartbeatDbStorer, error)
NewHeartbeatDbStorer will create an instance of HeartbeatDbStorer
func (*HeartbeatDbStorer) IsInterfaceNil ¶
func (hs *HeartbeatDbStorer) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeartbeatDbStorer) LoadGenesisTime ¶
func (hs *HeartbeatDbStorer) LoadGenesisTime() (time.Time, error)
LoadGenesisTime will return the genesis time saved in the storer
func (*HeartbeatDbStorer) LoadHeartBeatDTO ¶
func (hs *HeartbeatDbStorer) LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error)
LoadHeartBeatDTO will return the HeartbeatDTO for the given public key from storage
func (*HeartbeatDbStorer) LoadKeys ¶
func (hs *HeartbeatDbStorer) LoadKeys() ([][]byte, error)
LoadKeys will return the keys saved in the storer, representing public keys of all peers the node is connected to
func (*HeartbeatDbStorer) SaveKeys ¶
func (hs *HeartbeatDbStorer) SaveKeys(peersSlice [][]byte) error
SaveKeys will update the keys for all connected peers
func (*HeartbeatDbStorer) SavePubkeyData ¶
func (hs *HeartbeatDbStorer) SavePubkeyData( pubkey []byte, heartbeat *data.HeartbeatDTO, ) error
SavePubkeyData will add or update a HeartbeatDTO in the storer
func (*HeartbeatDbStorer) UpdateGenesisTime ¶
func (hs *HeartbeatDbStorer) UpdateGenesisTime(genesisTime time.Time) error
UpdateGenesisTime will update the saved genesis time and will log if the genesis time changed