github.com/ergo-services/ergo@v1.999.224/apps/cloud/app.go (about) 1 package cloud 2 3 import ( 4 "github.com/ergo-services/ergo/etf" 5 "github.com/ergo-services/ergo/gen" 6 "github.com/ergo-services/ergo/lib" 7 "github.com/ergo-services/ergo/node" 8 ) 9 10 type CloudApp struct { 11 gen.Application 12 options node.Cloud 13 } 14 15 func CreateApp(options node.Cloud) gen.ApplicationBehavior { 16 if options.Flags.Enable == false { 17 options.Flags = node.DefaultCloudFlags() 18 } 19 return &CloudApp{ 20 options: options, 21 } 22 } 23 24 func (ca *CloudApp) Load(args ...etf.Term) (gen.ApplicationSpec, error) { 25 lib.Log("CLOUD_CLIENT: Application load") 26 return gen.ApplicationSpec{ 27 Name: "cloud_app", 28 Description: "Ergo Cloud Support Application", 29 Version: "v.1.0", 30 Children: []gen.ApplicationChildSpec{ 31 gen.ApplicationChildSpec{ 32 Child: &cloudAppSup{}, 33 Name: "cloud_app_sup", 34 Args: []etf.Term{ca.options}, 35 }, 36 }, 37 }, nil 38 } 39 40 func (ca *CloudApp) Start(p gen.Process, args ...etf.Term) { 41 lib.Log("[%s] CLOUD_CLIENT: Application started", p.NodeName()) 42 }