Documentation ¶
Overview ¶
oneonone is a pubsub channel for communication between two peers
Index ¶
Constants ¶
View Source
const PROTOCOL = "ipfs-pubsub-direct-channel/v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel interface { events.EmitterInterface // ID Returns the Channel ID (pubsub topic) ID() string // Peers Returns the lists of peers expected to be in the channel Peers() []p2pcore.PeerID // Connect Waits for the other peer to be connected Connect(context.Context) error // Sends Sends a message to the other peer Send(context.Context, []byte) error // Close Closes the connection Close() error }
Channel Channel is a pubsub used for a direct communication between peers new messages are received via events
type EventMessage ¶
type EventMessage struct {
Payload []byte
}
EventMessage An event received on new messages
func NewEventMessage ¶
func NewEventMessage(payload []byte) *EventMessage
NewEventMessage Creates a new Message event
Click to show internal directories.
Click to hide internal directories.