Documentation ¶
Index ¶
- func Noop(_ interface{})
- type MembershipStore
- func (m *MembershipStore) MsgByID(pkiID common.PKIidType) *protos.SignedRKSyncMessage
- func (m *MembershipStore) Put(pkiID common.PKIidType, msg *protos.SignedRKSyncMessage)
- func (m *MembershipStore) Remove(pkiID common.PKIidType)
- func (m *MembershipStore) Size() int
- func (m *MembershipStore) ToSlice() []*protos.SignedRKSyncMessage
- type MessageStore
- type PubSub
- type Set
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MembershipStore ¶
MembershipStore struct which encapsulates membership message store abstraction
func NewMembershipStore ¶
func NewMembershipStore() *MembershipStore
NewMembershipStore creates new membership store instance
func (*MembershipStore) MsgByID ¶
func (m *MembershipStore) MsgByID(pkiID common.PKIidType) *protos.SignedRKSyncMessage
MsgByID returns a message stored by a certain ID, or nil if such an ID isn't found
func (*MembershipStore) Put ¶
func (m *MembershipStore) Put(pkiID common.PKIidType, msg *protos.SignedRKSyncMessage)
Put associates msg with the given PKI-ID
func (*MembershipStore) Remove ¶
func (m *MembershipStore) Remove(pkiID common.PKIidType)
Remove removes a message with a given pkiID
func (*MembershipStore) ToSlice ¶
func (m *MembershipStore) ToSlice() []*protos.SignedRKSyncMessage
ToSlice returns a slice backed by the elements of the MembershipStore
type MessageStore ¶
type MessageStore interface { Add(msg interface{}) bool CheckValid(msg interface{}) bool Size() int Get() []interface{} Stop() Purge(func(interface{}) bool) }
MessageStore adds message to an internal buffer
func NewMessageStore ¶
func NewMessageStore(pol common.MessageReplcaingPolicy, trigger invalidationTrigger) MessageStore
NewMessageStore returns a new MessageStore with the message replacing
func NewMessageStoreExpirable ¶
func NewMessageStoreExpirable(pol common.MessageReplcaingPolicy, trigger invalidationTrigger, msgTTL time.Duration, externalLock func(), externalUnlock func(), externalExpire func(interface{})) MessageStore
NewMessageStoreExpirable returns a new MessageStore with the message replacing It supports old message expiration after msgTTL
type PubSub ¶
PubSub defines a struct that one can use to: - publish items to a topic to multiple subscribers - and subscribe to items from a topic The subscriptions have a TTL and are cleaned when it passes.
func NewPubSub ¶
func NewPubSub() *PubSub
NewPubSub creates a new PubSub with an empty set of subscriptions
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set is a generic thread-safe set container
type Subscription ¶
type Subscription interface { // Listen blocks until a publish was made // to the subscription, or an error if the // subscription's TTL passed Listen() (interface{}, error) }
Subscription defines a subscription to a topic that can be used to receive publishes on