dtutils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 2

Documentation

Overview

Package dtutils provides go-data-transfer related types and functionality for client and provider FSMs

Index

Constants

This section is empty.

Variables

View Source
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

Jump to

Keyboard shortcuts

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