Add: external controller

This commit is contained in:
Dreamacro
2018-06-18 11:31:49 +08:00
parent bc4ca2818b
commit 79e5338113
5 changed files with 120 additions and 1 deletions

View File

@ -20,6 +20,21 @@ type Log struct {
Payload string
}
func (l *Log) Type() string {
switch l.LogType {
case INFO:
return "Info"
case WARNING:
return "Warning"
case ERROR:
return "Error"
case DEBUG:
return "Debug"
default:
return "Unknow"
}
}
func print(data Log) {
switch data.LogType {
case INFO:

View File

@ -34,6 +34,14 @@ func (t *Tunnel) Add(req C.ServerAdapter) {
t.queue.In() <- req
}
func (t *Tunnel) Traffic() *C.Traffic {
return t.traffic
}
func (t *Tunnel) Log() *observable.Observable {
return t.observable
}
func (t *Tunnel) UpdateConfig() (err error) {
cfg, err := C.GetConfig()
if err != nil {