Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler struct{}
MessageHandler is used to hold per-peer state for each connection. There is no state to hold for the v2 protocol, so this exists to provide a consistent interface between the protocol versions.
func NewMessageHandler ¶
func NewMessageHandler() *MessageHandler
NewMessageHandler creates a new MessageHandler
func (*MessageHandler) FromMsgReader ¶
func (mh *MessageHandler) FromMsgReader(_ peer.ID, r msgio.Reader) (message.GraphSyncMessage, error)
FromMsgReader can deserialize a DAG-CBOR message into a GraphySyncMessage
func (*MessageHandler) FromNet ¶
func (mh *MessageHandler) FromNet(p peer.ID, r io.Reader) (message.GraphSyncMessage, error)
FromNet can read a network stream to deserialized a GraphSyncMessage
func (*MessageHandler) ToNet ¶
func (mh *MessageHandler) ToNet(_ peer.ID, gsm message.GraphSyncMessage, w io.Writer) error
ToNet writes a GraphSyncMessage in its DAG-CBOR format to a writer, prefixed with a length uvar
Click to show internal directories.
Click to hide internal directories.