Documentation ¶
Index ¶
- type Ban
- type Connection
- type Event
- type State
- func (st *State) Add(ev Event)
- func (st *State) Close() error
- func (st *State) ConnectionsOf(name mesh.PeerName, f func(*Connection))
- func (st *State) Del(ev Event)
- func (st *State) Encode() [][]byte
- func (st *State) Has(ev Event) bool
- func (st *State) Merge(other mesh.GossipData) mesh.GossipData
- func (st *State) Subscriptions(f func(*Subscription, Value))
- func (st *State) SubscriptionsOf(name mesh.PeerName, f func(*Subscription))
- type Subscription
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Peer uint64 `binary:"-"` // The name of the peer. This must be first, since we're doing prefix search. Conn security.ID `binary:"-"` // The connection identifier. WillFlag bool WillRetain bool WillQoS uint8 WillTopic []byte WillMessage []byte ClientID []byte Username []byte }
Connection represents a banned key event.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State represents globally synchronised state.
func DecodeState ¶
DecodeState decodes the replicated state.
func (*State) ConnectionsOf ¶
func (st *State) ConnectionsOf(name mesh.PeerName, f func(*Connection))
ConnectionsOf iterates through the connection events for a specific peer.
func (*State) Merge ¶
func (st *State) Merge(other mesh.GossipData) mesh.GossipData
Merge merges the other GossipData into this one, and returns our resulting, complete state.
func (*State) Subscriptions ¶
func (st *State) Subscriptions(f func(*Subscription, Value))
Subscriptions iterates through all of the subscription units. This call is blocking and will lock the entire set of subscriptions while iterating.
func (*State) SubscriptionsOf ¶
func (st *State) SubscriptionsOf(name mesh.PeerName, f func(*Subscription))
SubscriptionsOf iterates through the subscription events for a specific peer.
type Subscription ¶
type Subscription struct { Peer uint64 `binary:"-"` // The name of the peer. This must be first, since we're doing prefix search. Conn security.ID `binary:"-"` // The connection identifier. Ssid message.Ssid `binary:"-"` // The SSID for the subscription. User nocopy.String // The connection username. Channel nocopy.Bytes // The channel string. }
Subscription represents a subscription event.
func (*Subscription) ConnID ¶
func (e *Subscription) ConnID() string
ConnID returns globally-unique identifier for the connection.