groupmulticast

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupMulticast

type GroupMulticast interface {

	// AddPeerToGroup add peers to the group which name is the given groupName.
	// If the group not exists, it will created.
	AddPeerToGroup(groupName string, peers ...peer.ID)

	// RemovePeerFromGroup remove peers from the group which name is the given groupName.
	RemovePeerFromGroup(groupName string, peers ...peer.ID)

	// GroupSize return the count of peers in the group which name is the given.
	// If the group not exists, return 0.
	GroupSize(groupName string) int

	// InGroup return whether the peer in the group.
	// If group not exists, return false.
	InGroup(groupName string, peer peer.ID) bool

	// RemoveGroup remove a group which name is the given.
	RemoveGroup(groupName string)

	// SendToGroupSync send data to the peers in the group sync.
	// It will wait until all data send success.
	SendToGroupSync(groupName string, protocolID protocol.ID, data []byte) error

	//SendToGroupAsync send data to group, no wait
	SendToGroupAsync(groupName string, protocolID protocol.ID, data []byte)
}

GroupMulticast send message to peers in group.

Jump to

Keyboard shortcuts

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