-
Notifications
You must be signed in to change notification settings - Fork 29
/
abstract.js
48 lines (41 loc) · 1010 Bytes
/
abstract.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
/**
* Licensed under the MIT License
*
* @author Kanstantsin A Kamkou (2ka.by)
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @link https://github.com/kkamkou/node-gelf-pro
*/
'use strict';
var zlib = require('zlib');
var abstract = Object.create(null, {
options: {enumerable: true, writable: true, value: {}}
});
/**
* Changes the configuration of the current adapter
* @param {Object} options
* @return {abstract}
*/
abstract.setOptions = function (options) {
this.options = options;
return this;
};
/**
* Message compression
* @param {String} message
* @param {Function} cb
* @return {abstract}
*/
abstract.deflate = function (message, cb) {
zlib.deflate(message, cb);
return this;
};
/**
* Sends a message to the server
* @param {String} message
* @param {Function} cb
*/
abstract.send = function (message, cb) { // eslint-disable-line
throw new Error('Redefine me please');
};
// exporting outside
module.exports = abstract;