-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
store.interface.ts
52 lines (45 loc) · 944 Bytes
/
store.interface.ts
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
/**
* Store for sessions
*/
export interface SessionStore {
/**
* Initialize this store on start application
*/
init(): Promise<void>;
/**
* Check exist SessionId in store
* @param sid SessionId
*/
exist(sid: string): Promise<boolean>;
/**
* Create SessionId in store
* @param sid SessionId
*/
create(sid: string): Promise<void>;
/**
* Delete Session from store
* @param sid SessionId
*/
delete(sid: string): Promise<void>;
/**
* Get object value by Session
* @param sid SessionId
*/
get(sid: string): Promise<any>;
/**
* @param sid SessionId
* @param key string
* @param value any
*/
setValue(sid: string, key: string, value: any): Promise<void>;
/**
* Returns value by key in store
* @param sid SessionId
* @param key string
*/
getValue(sid: string, key: string): Promise<any>;
/**
* Clear all store
*/
clear(): Promise<void>;
}