-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.go
70 lines (55 loc) · 1.17 KB
/
application.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package main
/*
#include "callback.h"
*/
import "C"
import (
"fmt"
"github.com/redeslab/simple-go/proxy"
)
const (
Success = iota
WalletFile = "wallet.json"
DataBase = "data"
)
type appConf struct {
baseDir string
walletPath string
dbPath string
BasIP string
}
func (ac appConf) String() string {
str := fmt.Sprintf("\n+++++++++++++++++++++++++++Application Config+++++++++++++++++++++++++"+
"\n base dir:%s"+
"\n wallet path:%s"+
"\n dbPath path:%s"+
"\n BAS ip:%s"+
"\n+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++",
ac.baseDir, ac.walletPath, ac.dbPath, ac.BasIP)
return str
}
type MacApp struct {
appConf
HopThreadSig chan struct{}
vpnSrv *proxy.VpnProxy
uiAPI C.UserInterfaceAPI
}
var _appInst = &MacApp{}
//export initConf
func initConf(baseDir, tokenAddr, mpsAddr, apiUrl, dns string, uiApi C.UserInterfaceAPI) *C.char {
return nil
}
//export startApp
func startApp() *C.char {
return nil
}
//export stopApp
func stopApp() {
}
//export startServing
func startServing(srvAddr, poolAddr, minerID string) (int, *C.char) {
return Success, nil
}
//export stopService
func stopService() {
}