Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPeerDoesNotSupportEBT = errors.New("peer does not support ebt")
Functions ¶
This section is empty.
Types ¶
type Contact ¶
type Contact struct {
// contains filtered or unexported fields
}
func MustNewContact ¶
func NewContact ¶
type ContactsStorage ¶
type EpidemicBroadcastTreesReplicator ¶
type EpidemicBroadcastTreesReplicator interface { // Replicate should keep attempting to perform replication as long as the // context isn't closed. Returning an error implies that replication should // not restart. Returns ErrPeerDoesNotSupportEBT if the peer doesn't support // EBT replication. Replicate(ctx context.Context, peer transport.Peer) error }
type FeedState ¶
type FeedState struct {
// contains filtered or unexported fields
}
FeedState wraps the sequence number so that both the state of feeds which have some messages in them and empty feeds can be represented.
func MustNewFeedState ¶
func NewEmptyFeedState ¶
func NewEmptyFeedState() FeedState
NewEmptyFeedState creates a new feed state which represents an empty feed. This is equivalent to the zero value of this type but using this constructor improves readability.
func NewFeedState ¶
NewFeedState creates a new feed state which represents a feed for which at least one message is known.
type Negotiator ¶
type Negotiator struct {
// contains filtered or unexported fields
}
func NewNegotiator ¶
func NewNegotiator( logger logging.Logger, ebtReplicator EpidemicBroadcastTreesReplicator, chsReplicator CreateHistoryStreamReplicator, ) *Negotiator
type RawMessageHandler ¶
type RawMessageHandler interface {
Handle(replicatedFrom identity.Public, msg message.RawMessage) error
}
type WantedFeed ¶
type WantedFeed struct {
// contains filtered or unexported fields
}
func MustNewWantedFeed ¶
func MustNewWantedFeed(who refs.Feed, feedState FeedState) WantedFeed
func NewWantedFeed ¶
func NewWantedFeed(who refs.Feed, feedState FeedState) (WantedFeed, error)
func (WantedFeed) FeedState ¶
func (w WantedFeed) FeedState() FeedState
func (WantedFeed) IsZero ¶
func (w WantedFeed) IsZero() bool
func (WantedFeed) Who ¶
func (w WantedFeed) Who() refs.Feed
type WantedFeeds ¶
type WantedFeeds struct {
// contains filtered or unexported fields
}
WantedFeeds contains contacts and other wanted feeds. Contacts are sorted by hops, ascending. Contacts include the local feed. Other feeds include other feeds which should be replicated. Other feeds may include the same feeds.
func MustNewWantedFeeds ¶
func MustNewWantedFeeds(contacts []Contact, otherFeeds []WantedFeed) WantedFeeds
func NewWantedFeeds ¶
func NewWantedFeeds(contacts []Contact, otherFeeds []WantedFeed) (WantedFeeds, error)
func (WantedFeeds) Contacts ¶
func (w WantedFeeds) Contacts() []Contact
func (WantedFeeds) OtherFeeds ¶
func (w WantedFeeds) OtherFeeds() []WantedFeed
type WantedFeedsCache ¶
type WantedFeedsCache struct {
// contains filtered or unexported fields
}
func NewWantedFeedsCache ¶
func NewWantedFeedsCache(provider WantedFeedsProvider) *WantedFeedsCache
func (*WantedFeedsCache) AddForkedFeed ¶
func (c *WantedFeedsCache) AddForkedFeed(replicatedFrom identity.Public, feed refs.Feed)
func (*WantedFeedsCache) GetContacts ¶
func (c *WantedFeedsCache) GetContacts(peer identity.Public) ([]Contact, error)
type WantedFeedsProvider ¶
type WantedFeedsProvider interface {
GetWantedFeeds() (WantedFeeds, error)
}
Click to show internal directories.
Click to hide internal directories.