orchestrationapi

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: 25 Imported by: 0

Documentation

Overview

Package orchestrationapi provides orchestration functionalities to handle distributed service in multi-device environment

Index

Constants

View Source
const (
	// ErrorNone is key no error
	ErrorNone = "ERROR_NONE"
	// InvalidParameter is key for invalid parameter
	InvalidParameter = "INVALID_PARAMETER"
	//ServiceNotFound is key for service not found
	ServiceNotFound = "SERVICE_NOT_FOUND"
	//InternalServerError is key for internal server error
	InternalServerError = "INTERNAL_SERVER_ERROR"
	// NotAllowedCommand is key for not allowed command
	NotAllowedCommand = "NOT_ALLOWED_COMMAND"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Orche

type Orche interface {
	Start(deviceIDPath string, platform string, executionType string)
}

Orche is the interface implemented by orchestration start function

type OrcheExternalAPI

type OrcheExternalAPI interface {
	RequestService(serviceInfo ReqeustService) ResponseService
	verifier.Conf
	RequestCloudSyncPublish(host string, clientID string, message string, topic string) string
	RequestCloudSyncSubscribe(host string, appID string, topic string) string
	RequestSubscribedData(clientID string, topic string, host string) string
}

OrcheExternalAPI is the interface implemented by external REST API

func GetExternalAPI

func GetExternalAPI() (OrcheExternalAPI, error)

GetExternalAPI registers the orchestration external API

type OrcheInternalAPI

type OrcheInternalAPI interface {
	configuremgr.Notifier
	ExecuteAppOnLocal(appInfo map[string]interface{})
	HandleNotificationOnLocal(serviceID float64, status string) error
	GetScore(target string) (scoreValue float64, err error)
	GetOrchestrationInfo() (platform string, executionType string, serviceList []string, err error)
	HandleDeviceInfo(deviceID string, virtualAddr string, privateAddr string)
	GetScoreWithResource(target map[string]interface{}) (scoreValue float64, err error)
	GetResource(target string) (resourceMsg map[string]interface{}, err error)
}

OrcheInternalAPI is the interface implemented by internal REST API

func GetInternalAPI

func GetInternalAPI() (OrcheInternalAPI, error)

GetInternalAPI registers the orchestration internal API

type OrchestrationBuilder

type OrchestrationBuilder struct {
	// contains filtered or unexported fields
}

OrchestrationBuilder has every interface to run orchestration

func (OrchestrationBuilder) Build

func (o OrchestrationBuilder) Build() Orche

Build registers every interface to run orchestration

func (*OrchestrationBuilder) SetClient

func (o *OrchestrationBuilder) SetClient(c client.Clienter)

SetClient registers the interface to send request to remote device

func (*OrchestrationBuilder) SetCloudSync added in v1.1.3

func (o *OrchestrationBuilder) SetCloudSync(d cloudsyncmgr.CloudSync)

SetCloudSync registers the interface to handle orchestration CloudSync

func (*OrchestrationBuilder) SetDiscovery

func (o *OrchestrationBuilder) SetDiscovery(d discoverymgr.Discovery)

SetDiscovery registers the interface to handle orchestration discovery

func (*OrchestrationBuilder) SetExecutor

func (o *OrchestrationBuilder) SetExecutor(e executor.ServiceExecutor)

SetExecutor registers the interface to execute platform-specific service application

func (*OrchestrationBuilder) SetScoring

func (o *OrchestrationBuilder) SetScoring(s scoringmgr.Scoring)

SetScoring registers the interface to handle resource scoring

func (*OrchestrationBuilder) SetService

func (o *OrchestrationBuilder) SetService(s servicemgr.ServiceMgr)

SetService registers the interface to handle executed service applications

func (*OrchestrationBuilder) SetStorage

func (o *OrchestrationBuilder) SetStorage(d storagemgr.Storage)

SetStorage registers the interface to handle orchestration Storage

func (*OrchestrationBuilder) SetVerifierConf

func (o *OrchestrationBuilder) SetVerifierConf(d verifier.Conf)

SetVerifierConf registers the interface to setting up verifier configuration

func (*OrchestrationBuilder) SetWatcher

func (o *OrchestrationBuilder) SetWatcher(w configuremgr.Watcher)

SetWatcher registers the interface to check if service applications are installed

type ReqeustService

type ReqeustService struct {
	SelfSelection    bool
	ServiceName      string
	ServiceRequester string
	ServiceInfo      []RequestServiceInfo
}

ReqeustService struct

type RequestServiceInfo

type RequestServiceInfo struct {
	ExecutionType string
	ExeCmd        []string
	ExeOption     map[string]interface{}
}

RequestServiceInfo struct

type ResponseService

type ResponseService struct {
	Message          string
	ServiceName      string
	RemoteTargetInfo TargetInfo
}

ResponseService struct

type TargetInfo

type TargetInfo struct {
	ExecutionType string
	Target        string
}

TargetInfo struct

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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