tree: a2b2863de82f906bd8c92d8435950df80284460b [path history] [tgz]
  1. executor.go


import ""

Package executor contains the Execute function for sending a replay to a device.


var ErrNoPostback = errors.New("No postback received")

ErrNoPostback is returned when a data for a postback could not be retrieved. This can be due to a connection problem or a decode error.

func Execute

func Execute(
	payload protocol.Payload,
	decoder builder.ResponseDecoder,
	connection io.ReadWriteCloser,
	database database.Database,
	logger log.Logger,
	handlers PostbackHandlerMap,
	byteOrder endian.ByteOrder) error

Execute sends the replay payload for execution on the target replay device communicating on connection. decoder will be used for decoding all postback reponses. Once a postback response is decoded, the corresponding handler in the handlers map will be called.

type PostbackHandlerMap

type PostbackHandlerMap map[atom.ID]func(data interface{}, err error)