Documentation ¶
Index ¶
- Variables
- func NewNodeKeeper(localRef reference.Holder, localRole member.PrimaryRole) beat.NodeKeeper
- func NewNodeNetwork(_ configuration.Transport, certificate nodeinfo.Certificate) (beat.NodeNetwork, error)
- type Accessor
- type MemoryStorage
- type Snapshot
- type StorageMem
- func (s *StorageMem) AddCommittedBeat(pulse beat.Beat) error
- func (s *StorageMem) AddExpectedBeat(beat.Beat) error
- func (s *StorageMem) EnsureLatestTimeBeat(pulse beat.Beat) error
- func (s *StorageMem) LatestTimeBeat() (beat.Beat, error)
- func (s *StorageMem) TimeBeat(pn pulse.Number) (beat.Beat, error)
- func (s *StorageMem) Trim(pn pulse.Number) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is returned when value was not found. ErrNotFound = errors.New("pulse not found") // ErrBadPulse is returned when appended Pulse is less than the latest. ErrBadPulse = errors.New("pulse should be greater than the latest") )
Functions ¶
func NewNodeKeeper ¶
func NewNodeKeeper(localRef reference.Holder, localRole member.PrimaryRole) beat.NodeKeeper
NewNodeKeeper create new NodeKeeper
func NewNodeNetwork ¶
func NewNodeNetwork(_ configuration.Transport, certificate nodeinfo.Certificate) (beat.NodeNetwork, error)
NewNodeNetwork create active node component
Types ¶
type Accessor ¶
type Accessor struct {
// contains filtered or unexported fields
}
func NewAccessor ¶
func (*Accessor) FindNodeByAddr ¶
func (a *Accessor) FindNodeByAddr(address string) profiles.ActiveNode
func (*Accessor) FindNodeByRef ¶
func (a *Accessor) FindNodeByRef(ref reference.Global) profiles.ActiveNode
func (*Accessor) GetPopulation ¶
func (a *Accessor) GetPopulation() census.OnlinePopulation
func (*Accessor) GetPulseNumber ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
NewMemoryStorage constructor creates MemoryStorage
func (*MemoryStorage) Append ¶
func (m *MemoryStorage) Append(snapshot *Snapshot) error
func (*MemoryStorage) ForPulseNumber ¶
func (m *MemoryStorage) ForPulseNumber(pulse pulse.Number) (*Snapshot, error)
func (*MemoryStorage) Last ¶
func (m *MemoryStorage) Last() *Snapshot
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func NewSnapshot ¶
func NewSnapshot(number pulse.Number, population census.OnlinePopulation) *Snapshot
NewSnapshot create new snapshot for pulse.
func (*Snapshot) GetPulseNumber ¶
type StorageMem ¶
type StorageMem struct {
// contains filtered or unexported fields
}
StorageMem is a memory storage implementation. It saves pulses to memory and allows removal.
func NewStorageMem ¶
func NewStorageMem() *StorageMem
NewStorageMem creates new memory storage instance.
func (*StorageMem) AddCommittedBeat ¶
func (s *StorageMem) AddCommittedBeat(pulse beat.Beat) error
func (*StorageMem) AddExpectedBeat ¶
func (s *StorageMem) AddExpectedBeat(beat.Beat) error
func (*StorageMem) EnsureLatestTimeBeat ¶
func (s *StorageMem) EnsureLatestTimeBeat(pulse beat.Beat) error
func (*StorageMem) LatestTimeBeat ¶
func (s *StorageMem) LatestTimeBeat() (beat.Beat, error)
LatestTimeBeat returns a latest pulse saved in memory. If not found, ErrNotFound will be returned.
Click to show internal directories.
Click to hide internal directories.