message

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataTransferMessage

type DataTransferMessage interface {
	IsRequest() bool
	TransferID() datatransfer.TransferID
	cborgen.CBORMarshaler
	cborgen.CBORUnmarshaler
	ToNet(w io.Writer) error
}

DataTransferMessage is a message for the data transfer protocol (either request or response) that can serialize to a protobuf

func FromNet

func FromNet(r io.Reader) (DataTransferMessage, error)

FromNet can read a network stream to deserialize a GraphSyncMessage

type DataTransferRequest

type DataTransferRequest interface {
	DataTransferMessage
	IsPull() bool
	VoucherType() string
	Voucher() []byte
	BaseCid() cid.Cid
	Selector() []byte
	IsCancel() bool
}

DataTransferRequest is a response message for the data transfer protocol

func CancelRequest

func CancelRequest(id datatransfer.TransferID) DataTransferRequest

CancelRequest request generates a request to cancel an in progress request

func NewRequest

func NewRequest(id datatransfer.TransferID, isPull bool, voucherIdentifier string, voucher []byte, baseCid cid.Cid, selector []byte) DataTransferRequest

NewRequest generates a new request for the data transfer protocol

type DataTransferResponse

type DataTransferResponse interface {
	DataTransferMessage
	Accepted() bool
}

DataTransferResponse is a response message for the data transfer protocol

func NewResponse

func NewResponse(id datatransfer.TransferID, accepted bool) DataTransferResponse

NewResponse builds a new Data Transfer response

Jump to

Keyboard shortcuts

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