services

package
v0.0.0-...-695150b Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

Package services ...

Package services ...

Package services ...

Index

Constants

View Source
const (
	// AccountSession holds the name for the Account and Session micro service
	AccountSession = "svc.account.session"
	// Tasks holds the name for the Task micro service
	Tasks = "svc.task"
	// APIClient holds the name for the API client micro service
	APIClient = "svc.api.gateway.client"
	// Aggregator holds the name for the Aggregator micro service
	Aggregator = "svc.aggregator"
	// Systems holds the name for the System Micro Service
	Systems = "svc.systems"
	// Events holds the name for the Events Micro Service
	Events = "svc.events"
	// Fabrics holds the name for the Fabrics Micro Service
	Fabrics = "svc.fabrics"
	// Managers holds the name for the Managers Micro Service
	Managers = "svc.managers"
)

Variables

View Source
var Service micro.Service

Service holds the microservice instance

Functions

func CreateChildTask

func CreateChildTask(sessionUserName string, parentTaskID string) (string, error)

CreateChildTask function is to contact the svc-task through the rpc call

func CreateTask

func CreateTask(sessionUserName string) (string, error)

CreateTask function is to contact the svc-task through the rpc call

func DeleteSubscription

func DeleteSubscription(uuid string) (*eventsproto.EventSubResponse, error)

DeleteSubscription calls the event service and delete all subscription realated to that server

func GetSessionUserName

func GetSessionUserName(sessionToken string) (string, error)

GetSessionUserName will get user name from the session token by rpc call to account-session service

func InitializeService

func InitializeService(serviceName string) error

InitializeService will initialize a new micro.Service. Service will be initialized here itself, so the Server() and Client() called easily.

func IsAuthorized

func IsAuthorized(sessionToken string, privileges, oemPrivileges []string) (int32, string)

IsAuthorized is used to authorize the services using svc-account-session. As parameters session token, privileges and oem privileges are passed. A RPC call is made with these parameters to the Account-Session service to check whether the session is valid and have all the privileges which are passed to it. After the RPC response, the function will return status code and status message back to the caller.

func SubscribeToEMB

func SubscribeToEMB(pluginID string, queueList []string)

SubscribeToEMB method will subscribe to respective event queue of the plugin

func UpdateTask

func UpdateTask(taskID string, taskState string, taskStatus string, percentComplete int32, payLoad *taskproto.Payload, endTime time.Time) error

UpdateTask function is to contact the svc-task through the rpc call

Types

This section is empty.

Jump to

Keyboard shortcuts

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