Documentation
¶
Index ¶
- func AttachListener(h host.Host, listener MessageReceiver)
- func GetFirstConnectionToPeer(host host.Host, pi peer.ID) *network.Conn
- func SendMessageToPeer(conn *network.Conn, msg *PlainOutboundMessage) error
- type EncryptedOutboundMessage
- func (m *EncryptedOutboundMessage) GetProtocolID() protocol.ID
- func (m *EncryptedOutboundMessage) GetRecipient() peer.ID
- func (m *EncryptedOutboundMessage) GetServiceName() string
- func (m *EncryptedOutboundMessage) GetTimeout() *time.Duration
- func (m *EncryptedOutboundMessage) Marshal() ([]byte, error)
- type ListenerPhase
- type MessageReceiver
- type OutboundMessage
- type PlainOutboundMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachListener ¶
func AttachListener(h host.Host, listener MessageReceiver)
func SendMessageToPeer ¶
func SendMessageToPeer(conn *network.Conn, msg *PlainOutboundMessage) error
Types ¶
type EncryptedOutboundMessage ¶
type EncryptedOutboundMessage struct { Recipient peer.ID PrivKey crypto.PrivKey ServiceName string ProtocolID protocol.ID Payload protobuf.Message Timeout *time.Duration }
func (*EncryptedOutboundMessage) GetProtocolID ¶
func (m *EncryptedOutboundMessage) GetProtocolID() protocol.ID
func (*EncryptedOutboundMessage) GetRecipient ¶
func (m *EncryptedOutboundMessage) GetRecipient() peer.ID
func (*EncryptedOutboundMessage) GetServiceName ¶
func (m *EncryptedOutboundMessage) GetServiceName() string
func (*EncryptedOutboundMessage) GetTimeout ¶
func (m *EncryptedOutboundMessage) GetTimeout() *time.Duration
func (*EncryptedOutboundMessage) Marshal ¶
func (m *EncryptedOutboundMessage) Marshal() ([]byte, error)
type ListenerPhase ¶
type ListenerPhase string
const ( SetupTimeout ListenerPhase = "setup-timeout" SetService ListenerPhase = "set-service" ReserveMemory ListenerPhase = "reserve-memory" ReadBytes ListenerPhase = "read-bytes" )
type MessageReceiver ¶
type OutboundMessage ¶
type PlainOutboundMessage ¶
type PlainOutboundMessage struct { Recipient peer.ID ServiceName string ProtocolID protocol.ID Payload protobuf.Message Timeout *time.Duration }
func (*PlainOutboundMessage) GetProtocolID ¶
func (m *PlainOutboundMessage) GetProtocolID() protocol.ID
func (*PlainOutboundMessage) GetRecipient ¶
func (m *PlainOutboundMessage) GetRecipient() peer.ID
func (*PlainOutboundMessage) GetServiceName ¶
func (m *PlainOutboundMessage) GetServiceName() string
func (*PlainOutboundMessage) GetTimeout ¶
func (m *PlainOutboundMessage) GetTimeout() *time.Duration
func (*PlainOutboundMessage) Marshal ¶
func (m *PlainOutboundMessage) Marshal() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.