Documentation ¶
Index ¶
- func CancelRequest(id datatransfer.TransferID) datatransfer.Request
- func CancelResponse(id datatransfer.TransferID) datatransfer.Response
- func CompleteResponse(id datatransfer.TransferID, isAccepted bool, isPaused bool, ...) (datatransfer.Response, error)
- func FromIPLD(node datamodel.Node) (datatransfer.Message, error)
- func FromNet(r io.Reader) (datatransfer.Message, error)
- func NewRequest(id datatransfer.TransferID, isRestart bool, isPull bool, ...) (datatransfer.Request, error)
- func NewResponse(id datatransfer.TransferID, accepted bool, isPaused bool, ...) (datatransfer.Response, error)
- func RestartExistingChannelRequest(channelId datatransfer.ChannelID) datatransfer.Request
- func RestartResponse(id datatransfer.TransferID, accepted bool, isPaused bool, ...) (datatransfer.Response, error)
- func UpdateRequest(id datatransfer.TransferID, isPaused bool) datatransfer.Request
- func UpdateResponse(id datatransfer.TransferID, isPaused bool) datatransfer.Response
- func ValidationResultResponse(messageType types.MessageType, id datatransfer.TransferID, ...) (datatransfer.Response, error)
- func VoucherRequest(id datatransfer.TransferID, voucher *datatransfer.TypedVoucher) (datatransfer.Request, error)
- func VoucherResultResponse(id datatransfer.TransferID, accepted bool, isPaused bool, ...) (datatransfer.Response, error)
- type TransferMessage1_1
- type TransferRequest1_1
- func (trq *TransferRequest1_1) BaseCid() cid.Cid
- func (trq *TransferRequest1_1) EmptyVoucher() bool
- func (trq *TransferRequest1_1) IsCancel() bool
- func (trq *TransferRequest1_1) IsNew() bool
- func (trq *TransferRequest1_1) IsPartial() bool
- func (trq *TransferRequest1_1) IsPaused() bool
- func (trq *TransferRequest1_1) IsPull() bool
- func (trq *TransferRequest1_1) IsRequest() bool
- func (trq *TransferRequest1_1) IsRestart() bool
- func (trq *TransferRequest1_1) IsRestartExistingChannelRequest() bool
- func (trq *TransferRequest1_1) IsUpdate() bool
- func (trq *TransferRequest1_1) IsVoucher() bool
- func (trq *TransferRequest1_1) MessageForProtocol(targetProtocol protocol.ID) (datatransfer.Message, error)
- func (trq *TransferRequest1_1) RestartChannelId() (datatransfer.ChannelID, error)
- func (trq *TransferRequest1_1) Selector() (datamodel.Node, error)
- func (trq *TransferRequest1_1) ToIPLD() datamodel.Node
- func (trq *TransferRequest1_1) ToNet(w io.Writer) error
- func (trq *TransferRequest1_1) TransferID() datatransfer.TransferID
- func (trq *TransferRequest1_1) TypedVoucher() (datatransfer.TypedVoucher, error)
- func (trq *TransferRequest1_1) Voucher() (datamodel.Node, error)
- func (trq *TransferRequest1_1) VoucherType() datatransfer.TypeIdentifier
- type TransferResponse1_1
- func (trsp *TransferResponse1_1) Accepted() bool
- func (trsp *TransferResponse1_1) EmptyVoucherResult() bool
- func (trsp *TransferResponse1_1) IsCancel() bool
- func (trsp *TransferResponse1_1) IsComplete() bool
- func (trsp *TransferResponse1_1) IsNew() bool
- func (trsp *TransferResponse1_1) IsPaused() bool
- func (trsp *TransferResponse1_1) IsRequest() bool
- func (trq *TransferResponse1_1) IsRestart() bool
- func (trsp *TransferResponse1_1) IsUpdate() bool
- func (trsp *TransferResponse1_1) IsValidationResult() bool
- func (trsp *TransferResponse1_1) MessageForProtocol(targetProtocol protocol.ID) (datatransfer.Message, error)
- func (trsp *TransferResponse1_1) ToIPLD() datamodel.Node
- func (trsp *TransferResponse1_1) ToNet(w io.Writer) error
- func (trsp *TransferResponse1_1) TransferID() datatransfer.TransferID
- func (trsp *TransferResponse1_1) VoucherResult() (datamodel.Node, error)
- func (trsp *TransferResponse1_1) VoucherResultType() datatransfer.TypeIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelRequest ¶
func CancelRequest(id datatransfer.TransferID) datatransfer.Request
CancelRequest request generates a request to cancel an in progress request
func CancelResponse ¶
func CancelResponse(id datatransfer.TransferID) datatransfer.Response
CancelResponse makes a new cancel response message
func CompleteResponse ¶
func CompleteResponse(id datatransfer.TransferID, isAccepted bool, isPaused bool, voucherResult *datatransfer.TypedVoucher) (datatransfer.Response, error)
CompleteResponse returns a new complete response message
func FromIPLD ¶
func FromIPLD(node datamodel.Node) (datatransfer.Message, error)
FromNet can read a network stream to deserialize a GraphSyncMessage
func FromNet ¶
func FromNet(r io.Reader) (datatransfer.Message, error)
FromNet can read a network stream to deserialize a GraphSyncMessage
func NewRequest ¶
func NewRequest(id datatransfer.TransferID, isRestart bool, isPull bool, voucher *datatransfer.TypedVoucher, baseCid cid.Cid, selector datamodel.Node) (datatransfer.Request, error)
NewRequest generates a new request for the data transfer protocol
func NewResponse ¶
func NewResponse(id datatransfer.TransferID, accepted bool, isPaused bool, voucherResult *datatransfer.TypedVoucher) (datatransfer.Response, error)
NewResponse builds a new Data Transfer response
func RestartExistingChannelRequest ¶
func RestartExistingChannelRequest(channelId datatransfer.ChannelID) datatransfer.Request
RestartExistingChannelRequest creates a request to ask the other side to restart an existing channel
func RestartResponse ¶
func RestartResponse(id datatransfer.TransferID, accepted bool, isPaused bool, voucherResult *datatransfer.TypedVoucher) (datatransfer.Response, error)
RestartResponse builds a new Data Transfer response
func UpdateRequest ¶
func UpdateRequest(id datatransfer.TransferID, isPaused bool) datatransfer.Request
UpdateRequest generates a new request update
func UpdateResponse ¶
func UpdateResponse(id datatransfer.TransferID, isPaused bool) datatransfer.Response
UpdateResponse returns a new update response
func ValidationResultResponse ¶
func ValidationResultResponse( messageType types.MessageType, id datatransfer.TransferID, validationResult datatransfer.ValidationResult, validationErr error, paused bool) (datatransfer.Response, error)
ValidationResultResponse response generates a response based on a validation result messageType determines what kind of response is created
func VoucherRequest ¶
func VoucherRequest(id datatransfer.TransferID, voucher *datatransfer.TypedVoucher) (datatransfer.Request, error)
VoucherRequest generates a new request for the data transfer protocol
func VoucherResultResponse ¶
func VoucherResultResponse(id datatransfer.TransferID, accepted bool, isPaused bool, voucherResult *datatransfer.TypedVoucher) (datatransfer.Response, error)
VoucherResultResponse builds a new response for a voucher result
Types ¶
type TransferMessage1_1 ¶
type TransferMessage1_1 struct { IsRequest bool Request *TransferRequest1_1 Response *TransferResponse1_1 }
TransferMessage1_1 is the transfer message for the 1.1 Data Transfer Protocol.
func (*TransferMessage1_1) ToIPLD ¶
func (tm *TransferMessage1_1) ToIPLD() (datamodel.Node, error)
ToIPLD converts a transfer message type to an ipld Node
func (*TransferMessage1_1) ToNet ¶
func (tm *TransferMessage1_1) ToNet(w io.Writer) error
ToNet serializes a transfer message type.
func (*TransferMessage1_1) TransferID ¶
func (tm *TransferMessage1_1) TransferID() datatransfer.TransferID
TransferID returns the TransferID of this message
type TransferRequest1_1 ¶
type TransferRequest1_1 struct { BaseCidPtr *cid.Cid MessageType uint64 Pause bool Partial bool Pull bool SelectorPtr datamodel.Node VoucherPtr datamodel.Node VoucherTypeIdentifier datatransfer.TypeIdentifier TransferId uint64 RestartChannel datatransfer.ChannelID }
TransferRequest1_1 is a struct for the 1.1 Data Transfer Protocol that fulfills the datatransfer.Request interface. its members are exported to be used by cbor-gen
func (*TransferRequest1_1) BaseCid ¶
func (trq *TransferRequest1_1) BaseCid() cid.Cid
BaseCid returns the Base CID
func (*TransferRequest1_1) EmptyVoucher ¶
func (trq *TransferRequest1_1) EmptyVoucher() bool
func (*TransferRequest1_1) IsCancel ¶
func (trq *TransferRequest1_1) IsCancel() bool
IsCancel returns true if this is a cancel request
func (*TransferRequest1_1) IsNew ¶
func (trq *TransferRequest1_1) IsNew() bool
func (*TransferRequest1_1) IsPartial ¶
func (trq *TransferRequest1_1) IsPartial() bool
IsPartial returns true if this is a partial request
func (*TransferRequest1_1) IsPaused ¶
func (trq *TransferRequest1_1) IsPaused() bool
func (*TransferRequest1_1) IsPull ¶
func (trq *TransferRequest1_1) IsPull() bool
========= datatransfer.Request interface IsPull returns true if this is a data pull request
func (*TransferRequest1_1) IsRequest ¶
func (trq *TransferRequest1_1) IsRequest() bool
IsRequest always returns true in this case because this is a transfer request
func (*TransferRequest1_1) IsRestart ¶
func (trq *TransferRequest1_1) IsRestart() bool
func (*TransferRequest1_1) IsRestartExistingChannelRequest ¶
func (trq *TransferRequest1_1) IsRestartExistingChannelRequest() bool
func (*TransferRequest1_1) IsUpdate ¶
func (trq *TransferRequest1_1) IsUpdate() bool
func (*TransferRequest1_1) IsVoucher ¶
func (trq *TransferRequest1_1) IsVoucher() bool
func (*TransferRequest1_1) MessageForProtocol ¶
func (trq *TransferRequest1_1) MessageForProtocol(targetProtocol protocol.ID) (datatransfer.Message, error)
func (*TransferRequest1_1) RestartChannelId ¶
func (trq *TransferRequest1_1) RestartChannelId() (datatransfer.ChannelID, error)
func (*TransferRequest1_1) Selector ¶
func (trq *TransferRequest1_1) Selector() (datamodel.Node, error)
Selector returns the message Selector bytes
func (*TransferRequest1_1) ToIPLD ¶
func (trq *TransferRequest1_1) ToIPLD() datamodel.Node
func (*TransferRequest1_1) ToNet ¶
func (trq *TransferRequest1_1) ToNet(w io.Writer) error
ToNet serializes a transfer request.
func (*TransferRequest1_1) TransferID ¶
func (trq *TransferRequest1_1) TransferID() datatransfer.TransferID
func (*TransferRequest1_1) TypedVoucher ¶
func (trq *TransferRequest1_1) TypedVoucher() (datatransfer.TypedVoucher, error)
TypedVoucher is a convenience method that returns the voucher and its typed as a TypedVoucher object TODO(rvagg): tests for this
func (*TransferRequest1_1) Voucher ¶
func (trq *TransferRequest1_1) Voucher() (datamodel.Node, error)
Voucher returns the Voucher bytes
func (*TransferRequest1_1) VoucherType ¶
func (trq *TransferRequest1_1) VoucherType() datatransfer.TypeIdentifier
VoucherType returns the Voucher ID
type TransferResponse1_1 ¶
type TransferResponse1_1 struct { MessageType uint64 RequestAccepted bool Paused bool TransferId uint64 VoucherResultPtr datamodel.Node VoucherTypeIdentifier datatransfer.TypeIdentifier }
TransferResponse1_1 is a private struct that satisfies the datatransfer.Response interface It is the response message for the Data Transfer 1.1 and 1.2 Protocol.
func (*TransferResponse1_1) Accepted ¶
func (trsp *TransferResponse1_1) Accepted() bool
Accepted returns true if the request is accepted in the response
func (*TransferResponse1_1) EmptyVoucherResult ¶
func (trsp *TransferResponse1_1) EmptyVoucherResult() bool
func (*TransferResponse1_1) IsCancel ¶
func (trsp *TransferResponse1_1) IsCancel() bool
IsCancel returns true if the responder has cancelled this response
func (*TransferResponse1_1) IsComplete ¶
func (trsp *TransferResponse1_1) IsComplete() bool
IsComplete returns true if the responder has completed this response
func (*TransferResponse1_1) IsNew ¶
func (trsp *TransferResponse1_1) IsNew() bool
IsNew returns true if this is the first response sent
func (*TransferResponse1_1) IsPaused ¶
func (trsp *TransferResponse1_1) IsPaused() bool
IsPaused returns true if the responder is paused
func (*TransferResponse1_1) IsRequest ¶
func (trsp *TransferResponse1_1) IsRequest() bool
IsRequest always returns false in this case because this is a transfer response
func (*TransferResponse1_1) IsRestart ¶
func (trq *TransferResponse1_1) IsRestart() bool
func (*TransferResponse1_1) IsUpdate ¶
func (trsp *TransferResponse1_1) IsUpdate() bool
IsUpdate returns true if this response is an update
func (*TransferResponse1_1) IsValidationResult ¶
func (trsp *TransferResponse1_1) IsValidationResult() bool
func (*TransferResponse1_1) MessageForProtocol ¶
func (trsp *TransferResponse1_1) MessageForProtocol(targetProtocol protocol.ID) (datatransfer.Message, error)
func (*TransferResponse1_1) ToIPLD ¶
func (trsp *TransferResponse1_1) ToIPLD() datamodel.Node
func (*TransferResponse1_1) ToNet ¶
func (trsp *TransferResponse1_1) ToNet(w io.Writer) error
ToNet serializes a transfer response.
func (*TransferResponse1_1) TransferID ¶
func (trsp *TransferResponse1_1) TransferID() datatransfer.TransferID
func (*TransferResponse1_1) VoucherResult ¶
func (trsp *TransferResponse1_1) VoucherResult() (datamodel.Node, error)
func (*TransferResponse1_1) VoucherResultType ¶
func (trsp *TransferResponse1_1) VoucherResultType() datatransfer.TypeIdentifier