Documentation ¶
Overview ¶
Package statematrix stores and provides useful operations on an state matrix for the Epidemic Broadcast Tree protocol.
The state matrix represents multiple _network frontiers_ (or vector clock).
This version uses a SQL because that seems much handier to handle such an irregular sparse matrix.
Q: * do we need a 2nd _told us about_ table?
Index ¶
- type HasLongerResult
- type ObservedFeed
- type StateMatrix
- func (sm *StateMatrix) Changed(self, peer refs.FeedRef) (ssb.NetworkFrontier, error)
- func (sm *StateMatrix) Close() error
- func (sm *StateMatrix) Fill(who refs.FeedRef, feeds []ObservedFeed) error
- func (sm *StateMatrix) HasLonger() ([]HasLongerResult, error)
- func (sm *StateMatrix) Inspect(peer refs.FeedRef) (ssb.NetworkFrontier, error)
- func (sm *StateMatrix) SaveAndClose(peer refs.FeedRef) error
- func (sm *StateMatrix) StateFileName(peer refs.FeedRef) (string, error)
- func (sm *StateMatrix) Update(who refs.FeedRef, update ssb.NetworkFrontier) (ssb.NetworkFrontier, error)
- func (sm *StateMatrix) WantsFeed(peer, feed refs.FeedRef) (bool, error)
- func (sm *StateMatrix) WantsList(peer refs.FeedRef) ([]refs.FeedRef, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HasLongerResult ¶
func (HasLongerResult) String ¶
func (hlr HasLongerResult) String() string
type StateMatrix ¶
type StateMatrix struct {
// contains filtered or unexported fields
}
func (*StateMatrix) Changed ¶
func (sm *StateMatrix) Changed(self, peer refs.FeedRef) (ssb.NetworkFrontier, error)
Changed returns which feeds have newer messages since last update
func (*StateMatrix) Close ¶
func (sm *StateMatrix) Close() error
func (*StateMatrix) Fill ¶
func (sm *StateMatrix) Fill(who refs.FeedRef, feeds []ObservedFeed) error
Fill might be deprecated. It just updates the current frontier state
func (*StateMatrix) HasLonger ¶
func (sm *StateMatrix) HasLonger() ([]HasLongerResult, error)
HasLonger returns all the feeds which have more messages then we have and who has them.
func (*StateMatrix) Inspect ¶ added in v0.2.1
func (sm *StateMatrix) Inspect(peer refs.FeedRef) (ssb.NetworkFrontier, error)
Inspect returns the current frontier for the passed peer
func (*StateMatrix) SaveAndClose ¶
func (sm *StateMatrix) SaveAndClose(peer refs.FeedRef) error
func (*StateMatrix) StateFileName ¶
func (sm *StateMatrix) StateFileName(peer refs.FeedRef) (string, error)
func (*StateMatrix) Update ¶
func (sm *StateMatrix) Update(who refs.FeedRef, update ssb.NetworkFrontier) (ssb.NetworkFrontier, error)
Update gets the current state from who, overwrites the notes in current with the new ones from the passed update and returns the complet updated frontier.