Documentation ¶
Overview ¶
Package dtutils provides go-data-transfer related types and functionality for client and provider FSMs
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDataTransferFailed means a data transfer for a deal failed ErrDataTransferFailed = errors.New("deal data transfer failed") )
Functions ¶
func ClientDataTransferSubscriber ¶
func ClientDataTransferSubscriber(deals EventReceiver) datatransfer.Subscriber
DataTransferSubscriber is the function called when an event occurs in a data transfer -- it reads the voucher to verify this even occurred in a storage market deal, then, based on the data transfer event that occurred, it dispatches an event to the appropriate state machine
func ProviderDataTransferSubscriber ¶
func ProviderDataTransferSubscriber(deals EventReceiver) datatransfer.Subscriber
DataTransferSubscriber is the function called when an event occurs in a data transfer -- it reads the voucher to verify this even occurred in a storage market deal, then, based on the data transfer event that occurred, it generates and update message for the deal -- either moving to staged for a completion event or moving to error if a data transfer error occurs
Types ¶
type EventReceiver ¶
type EventReceiver interface {
Send(id interface{}, name fsm.EventName, args ...interface{}) (err error)
}
EventReceiver is any thing that can receive FSM events