forked from serverless/serverless-google-cloudfunctions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.js
44 lines (37 loc) · 960 Bytes
/
serverless.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
'use strict';
// mock of the serverless instance
class Serverless {
constructor() {
this.providers = {};
this.service = {};
this.service.getAllFunctions = function () { //eslint-disable-line
return Object.keys(this.functions);
};
this.service.getFunction = function (functionName) { //eslint-disable-line
// NOTE the stage is always 'dev'!
this.functions[functionName]
.name = `${this.service}-dev-${functionName}`;
return this.functions[functionName];
};
this.utils = {
writeFileSync() {},
readFileSync() {},
};
this.cli = {
log() {},
consoleLog() {},
printDot() {},
};
this.plugins = [];
this.pluginManager = {
addPlugin: plugin => this.plugins.push(plugin),
};
}
setProvider(name, provider) {
this.providers[name] = provider;
}
getProvider(name) {
return this.providers[name];
}
}
module.exports = Serverless;