type XdsServer struct {
*Context
ID string
+ URLIndex string
BaseURL string
APIURL string
PartialURL string
return &XdsServer{
Context: ctx,
ID: _IDTempoPrefix + uuid.NewV1().String(),
+ URLIndex: conf.URLIndex,
BaseURL: conf.URL,
APIURL: conf.APIBaseURL + conf.APIPartialURL,
PartialURL: conf.APIPartialURL,
xs.logOut = out
}
+// GetConfig return the current server config
+func (xs *XdsServer) GetConfig() xaapiv1.ServerCfg {
+ return xaapiv1.ServerCfg{
+ ID: xs.ID,
+ URL: xs.BaseURL,
+ APIURL: xs.APIURL,
+ PartialURL: xs.PartialURL,
+ ConnRetry: xs.ConnRetry,
+ Connected: xs.Connected,
+ Disabled: xs.Disabled,
+ }
+}
+
// SendCommand Send a command to XDS Server
func (xs *XdsServer) SendCommand(cmd string, body []byte, res interface{}) error {
url := cmd
xs._Disconnected()
}
common.APIError(c, err.Error())
+ return
})
}
xs._Disconnected()
}
common.APIError(c, err.Error())
+ return
})
}
xs._Disconnected()
}
common.APIError(c, err.Error())
+ return
})
}
})
iosk.On("disconnection", func(err error) {
- xs.Log.Infof("IO.socket disconnection server %s", xs.ID)
+ xs.Log.Infof("IO.socket disconnection server %s (APIURL %s)", xs.ID, xs.APIURL)
if xs.CBOnDisconnect != nil {
xs.CBOnDisconnect(err)
}