summaryrefslogtreecommitdiff
path: root/rpc
diff options
context:
space:
mode:
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>2017-11-06 16:53:36 +0100
committerLukasz Wojciechowski <l.wojciechow@partner.samsung.com>2018-04-27 17:38:35 +0200
commite1c1c794486378cb67dd4682e9fb9b0d2bab26fa (patch)
tree66f09c95d893a2ffaf3856ad4c72f34082cf241d /rpc
parentc9d84756edae78371ce28a6552f213cbe6874292 (diff)
downloadboruta-e1c1c794486378cb67dd4682e9fb9b0d2bab26fa.tar.gz
boruta-e1c1c794486378cb67dd4682e9fb9b0d2bab26fa.tar.bz2
boruta-e1c1c794486378cb67dd4682e9fb9b0d2bab26fa.zip
Add rpc.dryad.ClientManager interface
This interface allows adding an abstraction layer between Dryad's client implementation and usage. It can be used also for using mocked up implementation od Dryad's client for test purposes. The mock implementation of interface is provided in workers package. It is generated using mockgen command: mockgen -package workers \ -destination=workers/dryadclientmanager_mock_test.go \ -write_package_comment=false \ -mock_names ClientManager=MockDryadClientManager \ git.tizen.org/tools/boruta/rpc/dryad ClientManager Change-Id: I7366a0e68a355c98b898fb00ec8efb3c642a725d Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/dryad/clientmanager.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/rpc/dryad/clientmanager.go b/rpc/dryad/clientmanager.go
new file mode 100644
index 0000000..9077d64
--- /dev/null
+++ b/rpc/dryad/clientmanager.go
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+// File rpc/dryad/clientmanager.go defines ClientManager interface with API
+// for managing client RPC calls to Dryad.
+
+package dryad
+
+import (
+ "net"
+
+ . "git.tizen.org/tools/boruta"
+)
+
+// ClientManager defines API for managing client RPC calls to Dryad.
+type ClientManager interface {
+ Dryad
+ // Create creates a new RPC client.
+ Create(net.IP, int) error
+ // Close shuts down RPC client connection.
+ Close() error
+}