-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
68 lines (59 loc) · 1.41 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
const { join } = require('path')
/**
* oak-tools module
* @version 0.2.0
* @module oak-tools
*/
/**
* Logger object
* @param {Object} options options object
* @param {Function} callback callback function
* @returns {Logger}
*/
module.exports.logger = function () {
return require(join(__dirname, 'lib', 'logger')).apply(this, arguments)
}
/**
* Message class
* @returns {Message}
*/
module.exports.message = function () {
return require(join(__dirname, 'lib', 'message'))
}
/**
* Starts a messaging server
* @param {String} type Type of server
* @returns {WebSocketServer}
*/
module.exports.server = function (type) {
return require(join(__dirname, 'lib', type, 'server'))
}
/**
* Starts a messaging client
* @param {String} type Type of client
* @returns {WebSocketClient}
*/
module.exports.client = function (type) {
return require(join(__dirname, 'lib', type, 'client'))
}
/**
* Service discovery
* @param {String} type Type of discovery
* @returns {Mdns}
*/
module.exports.discovery = function (type = 'mdns') {
return require(join(__dirname, 'lib', 'discovery', type))
}
/**
* Service advertiser
* @param {String} type Type of advertiser
* @returns {Mdns}
*/
module.exports.advertise = function (type = 'mdns') {
return require(join(__dirname, 'lib', 'advertise', type))
}
/**
* Swagger client generator
* @returns {Util}
*/
module.exports.api = require(join(__dirname, 'lib', 'api'))