Documentation ¶
Index ¶
- Variables
- type PeerGroupManager
- func (p *PeerGroupManager) AddPeerToGroup(groupName string, peers ...peer.ID)
- func (p *PeerGroupManager) GroupSize(groupName string) int
- func (p *PeerGroupManager) InGroup(groupName string, peer peer.ID) bool
- func (p *PeerGroupManager) RemoveGroup(groupName string)
- func (p *PeerGroupManager) RemovePeerFromGroup(groupName string, peers ...peer.ID)
- func (p *PeerGroupManager) SendToGroupAsync(groupName string, protocolID protocol.ID, data []byte) <-chan error
- func (p *PeerGroupManager) SendToGroupSync(groupName string, protocolID protocol.ID, data []byte) error
- type PeerGroups
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoPeerInGroup = errors.New("there is no peer in group")
)
Functions ¶
This section is empty.
Types ¶
type PeerGroupManager ¶
type PeerGroupManager struct {
// contains filtered or unexported fields
}
func (*PeerGroupManager) AddPeerToGroup ¶
func (p *PeerGroupManager) AddPeerToGroup(groupName string, peers ...peer.ID)
AddPeerToGroup adds a group of peers to the specified peer group.
func (*PeerGroupManager) GroupSize ¶
func (p *PeerGroupManager) GroupSize(groupName string) int
GroupSize returns the number of peers in the specified group.
func (*PeerGroupManager) InGroup ¶
func (p *PeerGroupManager) InGroup(groupName string, peer peer.ID) bool
InGroup checks if the specified peer is a member of the given group.
func (*PeerGroupManager) RemoveGroup ¶
func (p *PeerGroupManager) RemoveGroup(groupName string)
RemoveGroup removes the specified group from the peer group map.
func (*PeerGroupManager) RemovePeerFromGroup ¶
func (p *PeerGroupManager) RemovePeerFromGroup(groupName string, peers ...peer.ID)
RemovePeerFromGroup removes specified peers from the given peer group.
func (*PeerGroupManager) SendToGroupAsync ¶
func (p *PeerGroupManager) SendToGroupAsync(groupName string, protocolID protocol.ID, data []byte) <-chan error
SendToGroupAsync sends a data message asynchronously to all peers in the specified group.
func (*PeerGroupManager) SendToGroupSync ¶
func (p *PeerGroupManager) SendToGroupSync(groupName string, protocolID protocol.ID, data []byte) error
SendToGroupSync sends a data message synchronously to all peers in the specified group.
type PeerGroups ¶
Click to show internal directories.
Click to hide internal directories.