--- /dev/null
+/*
+ * 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 matcher/jobsmanager.go defines JobsManager interface with API
+// for managing jobs.
+
+package matcher
+
+import (
+ . "git.tizen.org/tools/boruta"
+ "git.tizen.org/tools/boruta/workers"
+)
+
+// JobsManager defines API for internal boruta management of jobs.
+type JobsManager interface {
+ // Create prepares a new job for the worker.
+ Create(ReqID, WorkerUUID) error
+ // Get returns pointer to a Job from JobsManager or error if no job for
+ // the worker is found.
+ Get(WorkerUUID) (*workers.Job, error)
+ // Finish cleans up after job is done.
+ Finish(WorkerUUID) error
+}
--- /dev/null
+// Code generated by MockGen. DO NOT EDIT.
+// Source: git.tizen.org/tools/boruta/matcher (interfaces: JobsManager)
+
+package matcher
+
+import (
+ boruta "git.tizen.org/tools/boruta"
+ workers "git.tizen.org/tools/boruta/workers"
+ gomock "github.com/golang/mock/gomock"
+ reflect "reflect"
+)
+
+// MockJobsManager is a mock of JobsManager interface
+type MockJobsManager struct {
+ ctrl *gomock.Controller
+ recorder *MockJobsManagerMockRecorder
+}
+
+// MockJobsManagerMockRecorder is the mock recorder for MockJobsManager
+type MockJobsManagerMockRecorder struct {
+ mock *MockJobsManager
+}
+
+// NewMockJobsManager creates a new mock instance
+func NewMockJobsManager(ctrl *gomock.Controller) *MockJobsManager {
+ mock := &MockJobsManager{ctrl: ctrl}
+ mock.recorder = &MockJobsManagerMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use
+func (m *MockJobsManager) EXPECT() *MockJobsManagerMockRecorder {
+ return m.recorder
+}
+
+// Create mocks base method
+func (m *MockJobsManager) Create(arg0 boruta.ReqID, arg1 boruta.WorkerUUID) error {
+ ret := m.ctrl.Call(m, "Create", arg0, arg1)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Create indicates an expected call of Create
+func (mr *MockJobsManagerMockRecorder) Create(arg0, arg1 interface{}) *gomock.Call {
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockJobsManager)(nil).Create), arg0, arg1)
+}
+
+// Finish mocks base method
+func (m *MockJobsManager) Finish(arg0 boruta.WorkerUUID) error {
+ ret := m.ctrl.Call(m, "Finish", arg0)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// Finish indicates an expected call of Finish
+func (mr *MockJobsManagerMockRecorder) Finish(arg0 interface{}) *gomock.Call {
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Finish", reflect.TypeOf((*MockJobsManager)(nil).Finish), arg0)
+}
+
+// Get mocks base method
+func (m *MockJobsManager) Get(arg0 boruta.WorkerUUID) (*workers.Job, error) {
+ ret := m.ctrl.Call(m, "Get", arg0)
+ ret0, _ := ret[0].(*workers.Job)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// Get indicates an expected call of Get
+func (mr *MockJobsManagerMockRecorder) Get(arg0 interface{}) *gomock.Call {
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockJobsManager)(nil).Get), arg0)
+}
--- /dev/null
+/*
+ * 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
+ */
+
+package workers
+
+import (
+ . "git.tizen.org/tools/boruta"
+ "git.tizen.org/tools/boruta/tunnels"
+)
+
+// Job describes worker job.
+type Job struct {
+ // Access describes details of the connection to Dryad. It is returned to the request
+ // owner when a job for request is run and acquired by the user.
+ Access AccessInfo
+ // Tunnel is a connection to Dryad for the user.
+ Tunnel tunnels.Tunneler
+ // Req is ID of the worked request.
+ Req ReqID
+}