Beispiel #1
0
func setupSimpleTransferrer(
	logger *logrus.Logger, cfg config.Config,
) (transferrer, error) {
	receiver := simple.NewReceiver(logger)
	return transferrer{
		interruptible:    receiver,
		transferSender:   simple.NewSender(logger),
		transferReceiver: receiver,
	}, nil
}
Beispiel #2
0
	var (
		logger       *logrus.Logger
		receiver     *simple.Receiver
		sender       *simple.Sender
		senderConn   net.Conn
		receiverConn net.Conn
	)

	BeforeEach(func() {
		logger = &logrus.Logger{
			Out:       GinkgoWriter,
			Level:     logrus.DebugLevel,
			Formatter: new(logrus.TextFormatter),
		}

		receiver = simple.NewReceiver(logger)
		sender = simple.NewSender(logger)

		senderConn, receiverConn = net.Pipe()
	})

	AfterEach(func() {
		Expect(senderConn.Close()).To(Succeed())
		Expect(receiverConn.Close()).To(Succeed())
	})

	Context("when the connection is closed", func() {
		var (
			senderConn   net.Conn
			receiverConn net.Conn
		)