groupmulticast

package
v0.0.0-...-d151d1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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

type PeerGroups map[string][]peer.ID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL