servicemgr

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package servicemgr manages service application execution

Index

Constants

View Source
const (
	// ConstKeyServiceID is key of service id
	ConstKeyServiceID = "ServiceID"

	// ConstKeyServiceName is key of service name
	ConstKeyServiceName = "ServiceName"

	// ConstKeyStatus is key of status
	ConstKeyStatus = "Status"

	// ConstKeyUserArgs is key of user argument
	ConstKeyUserArgs = "UserArgs"

	// ConstKeyRequester is key for requester
	ConstKeyRequester = "Requester"

	// 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"

	//ConstServicePort is open port for rest server
	ConstServicePort = 56001
)

Variables

View Source
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
)

Functions

This section is empty.

Types

type ConcurrentMap

type ConcurrentMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ConcurrentMap struct

func (*ConcurrentMap) Get

func (cm *ConcurrentMap) Get(key uint64) (interface{}, bool)

Get is for getting map item

func (*ConcurrentMap) Iter

func (cm *ConcurrentMap) Iter() <-chan ConcurrentMapItem

Iter is for iterating map item

func (*ConcurrentMap) Remove

func (cm *ConcurrentMap) Remove(key uint64)

Remove is for removing map item

func (*ConcurrentMap) Set

func (cm *ConcurrentMap) Set(key uint64, value interface{})

Set is for setting map item

type ConcurrentMapItem

type ConcurrentMapItem struct {
	Key   uint64
	Value interface{}
}

ConcurrentMapItem struct

type SMMgrImpl

type SMMgrImpl struct {
	client.HasClient
	// contains filtered or unexported fields
}

SMMgrImpl Structure

func GetInstance

func GetInstance() *SMMgrImpl

GetInstance returns the singletone SMMgrImpl instance

func (SMMgrImpl) Execute

func (sm SMMgrImpl) Execute(target, name, requester string, args []interface{}, notiChan chan string) (err error)

Execute selects local execution and remote execution

func (SMMgrImpl) ExecuteAppOnLocal

func (sm SMMgrImpl) ExecuteAppOnLocal(appInfo map[string]interface{})

ExecuteAppOnLocal fills out service execution info and deliver it to executor

func (*SMMgrImpl) SetLocalServiceExecutor

func (sm *SMMgrImpl) SetLocalServiceExecutor(s executor.ServiceExecutor)

SetLocalServiceExecutor sets executor and client

type ServiceDestroyResponse

type ServiceDestroyResponse struct {
	Return string `json:"Return"`
}

ServiceDestroyResponse structure

type ServiceExecutionResponse

type ServiceExecutionResponse struct {
	Status string `json:"Status"`
}

ServiceExecutionResponse structure

type ServiceMgr

type ServiceMgr interface {
	Execute(target, name, requester string, args []interface{}, notiChan chan string) (err error)
	SetLocalServiceExecutor(s executor.ServiceExecutor)

	// for internal api
	ExecuteAppOnLocal(appInfo map[string]interface{})

	// for client
	client.Setter
}

ServiceMgr is the interface to execute service application

type StatusNotification

type StatusNotification struct {
	ServiceID uint64 `json:"ServiceID"`
	Status    string `json:"Status"`
}

StatusNotification structure

Directories

Path Synopsis
Package executor provides struct and interface for multi-platform execution
Package executor provides struct and interface for multi-platform execution
androidexecutor
Package androidexecutor provides functions to execute service application in android native
Package androidexecutor provides functions to execute service application in android native
containerexecutor
Package containerexecutor provides functions to execute service application in container environment
Package containerexecutor provides functions to execute service application in container environment
containerexecutor/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
nativeexecutor
Package nativeexecutor provides functions to execute service application in Linux native
Package nativeexecutor provides functions to execute service application in Linux native
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package notification provides functions to manage notification after running service application
Package notification provides functions to manage notification after running service application
mocks
Package mock_notification is a generated GoMock package.
Package mock_notification is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL