Move tunnels from workers to separate package
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Tue, 31 Oct 2017 08:59:38 +0000 (09:59 +0100)
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Fri, 27 Apr 2018 15:34:20 +0000 (17:34 +0200)
commit38ef549139849d62ffe88af54af14ab7d456ebf8
treeb5dbd56c116f5ab8cd9c83cc1f1b703dbbef88fc
parent9eec2c2c3f17322be8d9eab30ff174f9173a2120
Move tunnels from workers to separate package

Tunnels package provides implementation of simple data forwarding
tunnels between IP addresses pairs.

The implementation has been moved from workers package and adjusted
to newly defined Tunneler interface. The interface defines basic
operations on tunnels (creation, getting address, closing).
It provides additional layer of abstraction allowing mockuping tests
of parts of the code using tunnels.

The mock implementation of interface is provided in matcher package.
It is generated using mockgen command:

mockgen -package matcher \
-destination=matcher/tunneler_mock_test.go \
-write_package_comment=false \
git.tizen.org/tools/boruta/tunnels Tunneler

Change-Id: Ida42f0134f0c365c8f1ffe772b859a0218c301ed
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
matcher/tunneler_mock_test.go [new file with mode: 0644]
tunnels/tunneler.go [new file with mode: 0644]
tunnels/tunnels.go [moved from workers/tunnel.go with 83% similarity]
tunnels/tunnels_suite_test.go [new file with mode: 0644]
tunnels/tunnels_test.go [moved from workers/tunnel_test.go with 89% similarity]