v1

package
v0.13.12 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0, MIT Imports: 20 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 {
	// contains filtered or unexported fields
}

MessageHandler is used to hold per-peer state for each connection. For the v1 protocol, we need to maintain a mapping of old style integer RequestIDs and the newer UUID forms. This happens on a per-peer basis and needs to work for both incoming and outgoing messages.

func NewMessageHandler

func NewMessageHandler() *MessageHandler

NewMessageHandler instantiates a new MessageHandler instance

func (*MessageHandler) FromMsgReader

func (mh *MessageHandler) FromMsgReader(p peer.ID, r msgio.Reader) (message.GraphSyncMessage, error)

FromMsgReader can deserialize a v1.0.0 protobuf message into a GraphySyncMessage

func (*MessageHandler) FromNet

FromNet can read a v1.0.0 network stream to deserialized a GraphSyncMessage

func (*MessageHandler) ToNet

ToNet writes a GraphSyncMessage in its v1.0.0 protobuf format to a writer

func (*MessageHandler) ToProto

func (mh *MessageHandler) ToProto(p peer.ID, gsm message.GraphSyncMessage) (*pb.Message, error)

toProto converts a GraphSyncMessage to its pb.Message equivalent

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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