-
Notifications
You must be signed in to change notification settings - Fork 31
/
dbLayer.go
47 lines (37 loc) · 1.57 KB
/
dbLayer.go
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
// WebCall Copyright 2023 timur.mobi. All rights reserved.
// By default dbLayer.go will forward all calls to skvLayer.go
// In the future other db-layers may be implemented
package main
func isLocalDb() bool {
return true
}
func GetOnlineCallee(calleeID string, ejectOn1stFound bool, reportBusyCallee bool, reportHiddenCallee bool, callerIpAddr string, comment string) (string,*Hub,*Hub,error) { // actual calleeID, hostingServerIp
urlID, locHub, err := locGetOnlineCallee(calleeID, ejectOn1stFound, reportBusyCallee, reportHiddenCallee,
callerIpAddr, comment)
return urlID, locHub, nil, err
}
func StoreCalleeInHubMap(key string, multiCallees string, remoteAddrWithPort string, wsClientID uint64, skipConfirm bool) (string,int64,error) {
return locStoreCalleeInHubMap(key, nil, multiCallees, remoteAddrWithPort, wsClientID, skipConfirm)
}
func SetUnHiddenForCaller(calleeId string, callerIp string) (error) {
return locSetUnHiddenForCaller(calleeId, callerIp)
}
func StoreCallerIpInHubMap(calleeId string, callerIp string, skipConfirm bool) error {
return locStoreCallerIpInHubMap(calleeId, callerIp, skipConfirm)
}
func SetCalleeHiddenState(calleeId string, hidden bool) (error) {
return locSetCalleeHiddenState(calleeId, hidden)
}
func GetRandomCalleeID() (string,error) {
return locGetRandomCalleeID()
}
func SearchCallerIpInHubMap(ipAddr string) (bool,string,error) {
return locSearchCallerIpInHubMap(ipAddr)
}
func DeleteFromHubMap(globalID string) (int64,int64) {
hublen,err := locDeleteFromHubMap(globalID)
if err!=nil {
return int64(0),int64(0)
}
return hublen,int64(0)
}