From 646362a75c1b16a3887792e14dd0acb954cc70a0 Mon Sep 17 00:00:00 2001 From: Adrian Zankich Date: Tue, 15 Apr 2014 19:26:07 -0700 Subject: [PATCH] Remove Reconnect and Disconnect from AdaptorInterface --- adaptor.go | 2 -- connection.go | 12 ------------ test_helper.go | 6 ++---- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/adaptor.go b/adaptor.go index 4407abf0..09772775 100644 --- a/adaptor.go +++ b/adaptor.go @@ -10,6 +10,4 @@ type Adaptor struct { type AdaptorInterface interface { Finalize() bool Connect() bool - Disconnect() bool - Reconnect() bool } diff --git a/connection.go b/connection.go index 80576b0f..73b99cc4 100644 --- a/connection.go +++ b/connection.go @@ -14,9 +14,7 @@ type connection struct { type Connection interface { Connect() bool - Disconnect() bool Finalize() bool - Reconnect() bool } func NewConnection(adaptor AdaptorInterface, r *Robot) *connection { @@ -38,17 +36,7 @@ func (c *connection) Connect() bool { return c.Adaptor.Connect() } -func (c *connection) Disconnect() bool { - log.Println("Disconnecting " + c.Name + "...") - return c.Adaptor.Disconnect() -} - func (c *connection) Finalize() bool { log.Println("Finalizing " + c.Name + "...") return c.Adaptor.Finalize() } - -func (c *connection) Reconnect() bool { - log.Println("Reconnecting to " + c.Name + " on port " + c.Port + "...") - return c.Adaptor.Reconnect() -} diff --git a/test_helper.go b/test_helper.go index d4ad4e88..d666230e 100644 --- a/test_helper.go +++ b/test_helper.go @@ -25,10 +25,8 @@ type testAdaptor struct { Adaptor } -func (me *testAdaptor) Finalize() bool { return true } -func (me *testAdaptor) Connect() bool { return true } -func (me *testAdaptor) Disconnect() bool { return true } -func (me *testAdaptor) Reconnect() bool { return true } +func (me *testAdaptor) Finalize() bool { return true } +func (me *testAdaptor) Connect() bool { return true } func newTestDriver(name string, adaptor *testAdaptor) *testDriver { d := new(testDriver)