summaryrefslogtreecommitdiffstats
path: root/lib/xdsserver/xdsserver.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xdsserver/xdsserver.go')
-rw-r--r--lib/xdsserver/xdsserver.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/xdsserver/xdsserver.go b/lib/xdsserver/xdsserver.go
index bb8f755..1079eba 100644
--- a/lib/xdsserver/xdsserver.go
+++ b/lib/xdsserver/xdsserver.go
@@ -48,6 +48,7 @@ type Context struct {
SThgInotCmd *exec.Cmd
mfolders *Folders
sdks *SDKs
+ targets *Targets
WWWServer *WebServer
sessions *Sessions
events *Events
@@ -129,7 +130,7 @@ func (ctx *Context) Run() (int, error) {
}
// Create events management
- ctx.events = NewEvents(ctx)
+ ctx.events = EventsConstructor(ctx)
// Create syncthing instance when section "syncthing" is present in server-config.json
if ctx.Config.FileConf.SThgConf != nil {
@@ -178,7 +179,7 @@ func (ctx *Context) Run() (int, error) {
}
// Init model folder
- ctx.mfolders = FoldersNew(ctx)
+ ctx.mfolders = FoldersConstructor(ctx)
// Load initial folders config from disk
if err := ctx.mfolders.LoadConfig(); err != nil {
@@ -186,16 +187,24 @@ func (ctx *Context) Run() (int, error) {
}
// Init cross SDKs
- ctx.sdks, err = NewSDKs(ctx)
+ ctx.sdks, err = SDKsConstructor(ctx)
if err != nil {
return -6, err
}
+ // Init target and terminals model
+ ctx.targets = TargetsConstructor(ctx)
+
+ // Load initial target & terminal config
+ if err := ctx.targets.LoadConfig(); err != nil {
+ return -6, err
+ }
+
// Create Web Server
- ctx.WWWServer = NewWebServer(ctx)
+ ctx.WWWServer = WebServerConstructor(ctx)
// Sessions manager
- ctx.sessions = NewClientSessions(ctx, cookieMaxAge)
+ ctx.sessions = ClientSessionsConstructor(ctx, cookieMaxAge)
// Run Web Server until exit requested (blocking call)
if err = ctx.WWWServer.Serve(); err != nil {