1.0.3 • Published 2 years ago

@mangar2/remoteservice v1.0.3

Weekly downloads
3
License
LGPL-3.0-or-later
Repository
github
Last release
2 years ago

Abstract

Interface to the opensense map service . Use it to send data to opensense map .

Provides a service to invoke broker messages from external networks . Allows only configured messages .

Contents

Meta

Fileindex.js
AbstractInterface to the opensense map service . Use it to send data to opensense map .
AuthorVolker Böhm
CopyrightCopyright ( c ) 2020 Volker Böhm
LicenseThis software is licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 3 . It is furnished "as is" , without any support , and with no warranty , express or implied , as to its usefulness for any purpose .
Fileremoteservice.js
AbstractProvides a service to invoke broker messages from external networks . Allows only configured messages .
AuthorVolker Böhm
CopyrightCopyright ( c ) 2020 Volker Böhm
LicenseThis software is licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 3 . It is furnished "as is" , without any support , and with no warranty , express or implied , as to its usefulness for any purpose .

Type definitions

Service {Object}

Service configuration | Name | Type | Description | | ---- | ---- | ------- | | path | string | | | path of the service | | | reason | string | | | service usage information used as reason string | | | qos | number | optional | 1 | quality of service | | | devices | Object | | | key : topic list | |

Global functions

prepare

prepare (config, remoteService) => {RemoteService}

Prepares the object

prepare Parameters

NameTypeAttributeDefaultDescription
configObjectremote service configuration
remoteServiceRemoteServiceoptionalnullexisting remote service class

prepare returns

TypeDescription
RemoteServicethe prepared remote service object

Class RemoteService

new RemoteService(options)

Creates a remote service

RemoteService Parameters

NameTypeAttributeDefaultDescription
optionsObjectoptional{ }remote server parameter

options properties

NameTypeDescription
servicesArray.<Service>list of supported services

RemoteService Methods

close

async close ()

Closes the broker , stops listening

on

on (event, callback)

Sets a callback .

on Parameters
NameTypeDescription
eventstringevent name ( not case sensitive ) for the callback
callbackfunctionfunction ( . . . parameter )
on throws
TypeDescription
Errorif the event is not supported
Errorif the callback is not 'function'

run

run ()

Listens to a configured port