storage

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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