diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-02-23 18:45:15 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-02-23 18:45:15 +0100 |
commit | 65e09e831cf13343ac713fbf15281174d1f13a94 (patch) | |
tree | 0176a263ecf6d1059a272007c6f450770f5792ca /lib/xdsserver/xdsserver.go | |
parent | e97eebc18d726aa55738d7e19513491cf58a6e3a (diff) |
Added target and terminal support.v1.1.0
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver/xdsserver.go')
-rw-r--r-- | lib/xdsserver/xdsserver.go | 19 |
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 { |