Clean up servicemgr pkg 89/203289/1
authorjw_wonny.cha <jw_wonny.cha@samsung.com>
Thu, 11 Apr 2019 08:44:20 +0000 (17:44 +0900)
committerjw_wonny.cha <jw_wonny.cha@samsung.com>
Thu, 11 Apr 2019 08:44:20 +0000 (17:44 +0900)
Change-Id: I02acf26b69e369415e2f8fe432ae9687ef42382c
Signed-off-by: jw_wonny.cha <jw_wonny.cha@samsung.com>
src/servicemgr/common_test.go [deleted file]
src/servicemgr/configure.go [deleted file]
src/servicemgr/service_map.go
src/servicemgr/types.go
src/servicemgr/types_test.go [moved from src/servicemgr/types_concurrent_map_test.go with 99% similarity]

diff --git a/src/servicemgr/common_test.go b/src/servicemgr/common_test.go
deleted file mode 100755 (executable)
index 47e646e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright 2019 Samsung Electronics 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 servicemgr_test
-
-import (
-       "strings"
-       "testing"
-)
-
-const (
-       serviceName  = "ls"
-       serviceName2 = "main2"
-)
-
-func assertEqualStr(t *testing.T, a, b string) {
-       t.Helper()
-       if strings.Compare(a, b) != 0 {
-               t.Errorf("%s != %s", a, b)
-       }
-}
-
-func retError(t *testing.T, err error) {
-       t.Helper()
-
-       if err != nil {
-               t.Error(err.Error())
-       }
-}
diff --git a/src/servicemgr/configure.go b/src/servicemgr/configure.go
deleted file mode 100755 (executable)
index 6fef8bb..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright 2019 Samsung Electronics 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 servicemgr
-
-import "errors"
-
-const (
-       // ConstKeyServiceID is key of service id
-       ConstKeyServiceID = "ServiceID"
-
-       // ConstKeyServiceName is key of service name
-       ConstKeyServiceName = "ServiceName"
-
-       // ConstKeyNotiChan is key of notification channel
-       ConstKeyNotiChan = "NotiChan"
-
-       // ConstKeyStatus is key of status
-       ConstKeyStatus = "Status"
-
-       // ConstKeyUserArgs is key of user argument
-       ConstKeyUserArgs = "UserArgs"
-
-       // ConstKeyNotiTargetURL is key of notification target URL
-       ConstKeyNotiTargetURL = "NotificationTargetURL"
-
-       // ConstServiceStatusFailed is service status is failed
-       ConstServiceStatusFailed = "Failed"
-
-       // ConstServiceStatusStarted is service status is started
-       ConstServiceStatusStarted = "Started"
-
-       // ConstServiceStatusFinished is service status is finished
-       ConstServiceStatusFinished = "Finished"
-
-       // ConstServiceFound is service status is found
-       ConstServiceFound = "Found"
-
-       // ConstServiceNotFound is service status is not found
-       ConstServiceNotFound = "NotFound"
-
-       // ConstServiceExecuteURI is URI for creating & executing service
-       ConstServiceExecuteURI = "/api/v1/servicemgr/services"
-
-       // ConstServiceStatusNotiURI is URI for notification status of service
-       ConstServiceStatusNotiURI = "/api/v1/servicemgr/services/notification/"
-)
-
-var (
-       // ErrInvalidService is for error type of invalid service
-       ErrInvalidService = errors.New("It is Invalid Service")
-
-       // ServiceMap is service map
-       ServiceMap ConcurrentMap
-
-       // ServiceIdx is for unique service ID (process id)
-       ServiceIdx uint64
-)
index 93514bd..8b72954 100755 (executable)
@@ -1,3 +1,5 @@
+package servicemgr
+
 /*******************************************************************************
  * Copyright 2019 Samsung Electronics All Rights Reserved.
  *
@@ -14,7 +16,6 @@
  * limitations under the License.
  *
  *******************************************************************************/
-package servicemgr
 
 import (
        "sync/atomic"
index 92251ed..d782c72 100755 (executable)
@@ -1,3 +1,5 @@
+package servicemgr
+
 /*******************************************************************************
  * Copyright 2019 Samsung Electronics All Rights Reserved.
  *
  * limitations under the License.
  *
  *******************************************************************************/
-package servicemgr
 
-import "sync"
+import (
+       "errors"
+       "sync"
+)
+
+const (
+       // ConstKeyServiceID is key of service id
+       ConstKeyServiceID = "ServiceID"
+
+       // ConstKeyServiceName is key of service name
+       ConstKeyServiceName = "ServiceName"
+
+       // ConstKeyNotiChan is key of notification channel
+       ConstKeyNotiChan = "NotiChan"
+
+       // ConstKeyStatus is key of status
+       ConstKeyStatus = "Status"
+
+       // ConstKeyUserArgs is key of user argument
+       ConstKeyUserArgs = "UserArgs"
+
+       // ConstKeyNotiTargetURL is key of notification target URL
+       ConstKeyNotiTargetURL = "NotificationTargetURL"
+
+       // ConstServiceStatusFailed is service status is failed
+       ConstServiceStatusFailed = "Failed"
+
+       // ConstServiceStatusStarted is service status is started
+       ConstServiceStatusStarted = "Started"
+
+       // ConstServiceStatusFinished is service status is finished
+       ConstServiceStatusFinished = "Finished"
+
+       // ConstServiceFound is service status is found
+       ConstServiceFound = "Found"
+
+       // ConstServiceNotFound is service status is not found
+       ConstServiceNotFound = "NotFound"
+)
+
+var (
+       logPrefix = "servicemgr"
+
+       // ErrInvalidService is for error type of invalid service
+       ErrInvalidService = errors.New("It is Invalid Service")
+
+       // ServiceMap is service map
+       ServiceMap ConcurrentMap
 
-var logPrefix = "servicemgr"
+       // ServiceIdx is for unique service ID (process id)
+       ServiceIdx uint64
+)
 
 // ServiceParam structrue
 type ServiceParam struct {
similarity index 99%
rename from src/servicemgr/types_concurrent_map_test.go
rename to src/servicemgr/types_test.go
index 113b6e6..490faba 100755 (executable)
@@ -1,3 +1,5 @@
+package servicemgr_test
+
 /*******************************************************************************
  * Copyright 2019 Samsung Electronics All Rights Reserved.
  *
@@ -14,7 +16,6 @@
  * limitations under the License.
  *
  *******************************************************************************/
-package servicemgr_test
 
 import (
        "servicemgr"