v2

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0, MIT Imports: 15 Imported by: 0

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

FromNet can read a network stream to deserialized a GraphSyncMessage

func (*MessageHandler) ToNet

ToNet writes a GraphSyncMessage in its DAG-CBOR format to a writer, prefixed with a length uvar

Jump to

Keyboard shortcuts

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