internal

package
v2.0.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CborGenCompatibleNode

type CborGenCompatibleNode struct {
	Node datamodel.Node
}

func (CborGenCompatibleNode) IsNull

func (sn CborGenCompatibleNode) IsNull() bool

func (*CborGenCompatibleNode) MarshalCBOR

func (sn *CborGenCompatibleNode) MarshalCBOR(w io.Writer) error

MarshalCBOR is for cbor-gen compatibility

func (*CborGenCompatibleNode) UnmarshalCBOR

func (sn *CborGenCompatibleNode) UnmarshalCBOR(r io.Reader) error

UnmarshalCBOR is for cbor-gen compatibility

type ChannelState

type ChannelState struct {
	// PeerId of the manager peer
	SelfPeer peer.ID
	// an identifier for this channel shared by request and responder, set by requester through protocol
	TransferID datatransfer.TransferID
	// Initiator is the person who intiated this datatransfer request
	Initiator peer.ID
	// Responder is the person who is responding to this datatransfer request
	Responder peer.ID
	// base CID for the piece being transferred
	BaseCid cid.Cid
	// portion of Piece to return, specified by an IPLD selector
	Selector CborGenCompatibleNode
	// the party that is sending the data (not who initiated the request)
	Sender peer.ID
	// the party that is receiving the data (not who initiated the request)
	Recipient peer.ID
	// expected amount of data to be transferred
	TotalSize uint64
	// current status of this deal
	Status datatransfer.Status
	// total bytes read from this node and queued for sending (0 if receiver)
	Queued uint64
	// total bytes sent from this node (0 if receiver)
	Sent uint64
	// total bytes received by this node (0 if sender)
	Received uint64
	// more informative status on a channel
	Message        string
	Vouchers       []EncodedVoucher
	VoucherResults []EncodedVoucherResult
	// Number of blocks that have been received, including blocks that are
	// present in more than one place in the DAG
	ReceivedBlocksTotal int64
	// Number of blocks that have been queued, including blocks that are
	// present in more than one place in the DAG
	QueuedBlocksTotal int64
	// Number of blocks that have been sent, including blocks that are
	// present in more than one place in the DAG
	SentBlocksTotal int64
	// DataLimit is the maximum data that can be transferred on this channel before
	// revalidation. 0 indicates no limit.
	DataLimit uint64
	// RequiresFinalization indicates at the end of the transfer, the channel should
	// be left open for a final settlement
	RequiresFinalization bool
	// ResponderPaused indicates whether the responder is in a paused state
	ResponderPaused bool
	// InitiatorPaused indicates whether the initiator is in a paused state
	InitiatorPaused bool
	// Stages traces the execution fo a data transfer.
	//
	// EXPERIMENTAL; subject to change.
	Stages *datatransfer.ChannelStages
}

ChannelState is the internal representation on disk for the channel fsm

func (*ChannelState) AddLog

func (cs *ChannelState) AddLog(msg string, a ...interface{})

AddLog takes an fmt string with arguments, and adds the formatted string to the logs for the current deal stage.

EXPERIMENTAL; subject to change.

func (*ChannelState) MarshalCBOR

func (t *ChannelState) MarshalCBOR(w io.Writer) error

func (*ChannelState) UnmarshalCBOR

func (t *ChannelState) UnmarshalCBOR(r io.Reader) error

type EncodedVoucher

type EncodedVoucher struct {
	// Vouchers identifier for decoding
	Type datatransfer.TypeIdentifier
	// used to verify this channel
	Voucher CborGenCompatibleNode
}

EncodedVoucher is how the voucher is stored on disk

func (*EncodedVoucher) MarshalCBOR

func (t *EncodedVoucher) MarshalCBOR(w io.Writer) error

func (*EncodedVoucher) UnmarshalCBOR

func (t *EncodedVoucher) UnmarshalCBOR(r io.Reader) error

type EncodedVoucherResult

type EncodedVoucherResult struct {
	// Vouchers identifier for decoding
	Type datatransfer.TypeIdentifier
	// used to verify this channel
	VoucherResult CborGenCompatibleNode
}

EncodedVoucherResult is how the voucher result is stored on disk

func (*EncodedVoucherResult) MarshalCBOR

func (t *EncodedVoucherResult) MarshalCBOR(w io.Writer) error

func (*EncodedVoucherResult) UnmarshalCBOR

func (t *EncodedVoucherResult) UnmarshalCBOR(r io.Reader) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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