forked from TencentCloud/tcb-sdk-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CloudBase.cs
40 lines (35 loc) · 1.05 KB
/
CloudBase.cs
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
namespace CloudBase
{
public class CloudBaseApp
{
private static object _sync = new object();
private static CloudBaseApp Instance;
private readonly Core Core;
public readonly Auth Auth;
public readonly Function Function;
public readonly Storage Storage;
public readonly Database Db;
private CloudBaseApp(string env, int timeout)
{
this.Core = new Core(env, timeout);
this.Auth = new Auth(this.Core);
this.Function = new Function(this.Core);
this.Storage = new Storage(this.Core);
this.Db = new Database(this.Core);
}
public static CloudBaseApp Init(string env, int timeout)
{
if (Instance == null)
{
lock (_sync)
{
if (Instance == null)
{
Instance = new CloudBaseApp(env, timeout);
}
}
}
return Instance;
}
}
}