Documentation
¶
Index ¶
- type DataTransferMessage
- type DataTransferRequest
- func CancelRequest(id datatransfer.TransferID) DataTransferRequest
- func NewRequest(id datatransfer.TransferID, isPull bool, vtype datatransfer.TypeIdentifier, ...) (DataTransferRequest, error)
- func UpdateRequest(id datatransfer.TransferID, isPaused bool) DataTransferRequest
- func VoucherRequest(id datatransfer.TransferID, vtype datatransfer.TypeIdentifier, ...) (DataTransferRequest, error)
- type DataTransferResponse
- func CancelResponse(id datatransfer.TransferID) DataTransferResponse
- func CompleteResponse(id datatransfer.TransferID, isAccepted bool, isPaused bool, ...) (DataTransferResponse, error)
- func NewResponse(id datatransfer.TransferID, accepted bool, isPaused bool, ...) (DataTransferResponse, error)
- func UpdateResponse(id datatransfer.TransferID, isPaused bool) DataTransferResponse
- func VoucherResultResponse(id datatransfer.TransferID, accepted bool, isPaused bool, ...) (DataTransferResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataTransferMessage ¶
type DataTransferMessage interface {
IsRequest() bool
IsNew() bool
IsUpdate() bool
IsPaused() bool
IsCancel() 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
type DataTransferRequest ¶
type DataTransferRequest interface {
DataTransferMessage
IsPull() bool
IsVoucher() bool
VoucherType() datatransfer.TypeIdentifier
Voucher(decoder encoding.Decoder) (encoding.Encodable, error)
BaseCid() cid.Cid
Selector() (ipld.Node, error)
}
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, vtype datatransfer.TypeIdentifier, voucher encoding.Encodable, baseCid cid.Cid, selector ipld.Node) (DataTransferRequest, error)
NewRequest generates a new request for the data transfer protocol
func UpdateRequest ¶ added in v0.4.0
func UpdateRequest(id datatransfer.TransferID, isPaused bool) DataTransferRequest
UpdateRequest generates a new request update
func VoucherRequest ¶ added in v0.4.0
func VoucherRequest(id datatransfer.TransferID, vtype datatransfer.TypeIdentifier, voucher encoding.Encodable) (DataTransferRequest, error)
VoucherRequest generates a new request for the data transfer protocol
type DataTransferResponse ¶
type DataTransferResponse interface {
DataTransferMessage
IsVoucherResult() bool
IsComplete() bool
Accepted() bool
VoucherResultType() datatransfer.TypeIdentifier
VoucherResult(decoder encoding.Decoder) (encoding.Encodable, error)
EmptyVoucherResult() bool
}
DataTransferResponse is a response message for the data transfer protocol
func CancelResponse ¶ added in v0.4.0
func CancelResponse(id datatransfer.TransferID) DataTransferResponse
CancelResponse makes a new cancel response message
func CompleteResponse ¶ added in v0.4.0
func CompleteResponse(id datatransfer.TransferID, isAccepted bool, isPaused bool, voucherResultType datatransfer.TypeIdentifier, voucherResult encoding.Encodable) (DataTransferResponse, error)
CompleteResponse returns a new complete response message
func NewResponse ¶
func NewResponse(id datatransfer.TransferID, accepted bool, isPaused bool, voucherResultType datatransfer.TypeIdentifier, voucherResult encoding.Encodable) (DataTransferResponse, error)
NewResponse builds a new Data Transfer response
func UpdateResponse ¶ added in v0.4.0
func UpdateResponse(id datatransfer.TransferID, isPaused bool) DataTransferResponse
UpdateResponse returns a new update response
func VoucherResultResponse ¶ added in v0.4.0
func VoucherResultResponse(id datatransfer.TransferID, accepted bool, isPaused bool, voucherResultType datatransfer.TypeIdentifier, voucherResult encoding.Encodable) (DataTransferResponse, error)
VoucherResultResponse builds a new response for a voucher result