+++ /dev/null
-/*******************************************************************************
- * 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())
- }
-}
+++ /dev/null
-/*******************************************************************************
- * 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
-)
+package servicemgr
+
/*******************************************************************************
* Copyright 2019 Samsung Electronics All Rights Reserved.
*
* limitations under the License.
*
*******************************************************************************/
-package servicemgr
import (
"sync/atomic"
+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 {
+package servicemgr_test
+
/*******************************************************************************
* Copyright 2019 Samsung Electronics All Rights Reserved.
*
* limitations under the License.
*
*******************************************************************************/
-package servicemgr_test
import (
"servicemgr"