refactor: converted int64 to int32 where appropriate.

refactor: reduced usage of fmt in favor of logs and string concatication.

refactor: minor re-ordering of the data structures to reduce storage space required.
This commit is contained in:
James Wells 2023-03-21 07:34:10 -07:00
parent 8640d42132
commit 1bcc682b7c
Signed by: jwells
GPG key ID: 73196D10B8E65666
9 changed files with 53 additions and 48 deletions

View file

@ -24,9 +24,9 @@ func Main(wg *sync.WaitGroup, config gs.GagentConfig) {
rootBody.SetAttributeValue("mode", cty.StringVal(config.Mode))
rootBody.SetAttributeValue("uuid", cty.StringVal(config.UUID))
rootBody.SetAttributeValue("listenaddr", cty.StringVal("0.0.0.0"))
rootBody.SetAttributeValue("clientport", cty.NumberIntVal(config.ClientPort))
rootBody.SetAttributeValue("routerport", cty.NumberIntVal(config.RouterPort))
rootBody.SetAttributeValue("workerport", cty.NumberIntVal(config.WorkerPort))
rootBody.SetAttributeValue("clientport", cty.NumberIntVal(int64(config.ClientPort)))
rootBody.SetAttributeValue("routerport", cty.NumberIntVal(int64(config.RouterPort)))
rootBody.SetAttributeValue("workerport", cty.NumberIntVal(int64(config.WorkerPort)))
rootBody.AppendNewline()
clientBlock1 := rootBody.AppendNewBlock("client", []string{config.Name})
@ -47,9 +47,9 @@ func Main(wg *sync.WaitGroup, config gs.GagentConfig) {
routerBody1 := routerBlock1.Body()
routerBody1.SetAttributeValue("routerid", cty.StringVal(config.UUID))
routerBody1.SetAttributeValue("address", cty.StringVal("127.0.0.1"))
routerBody1.SetAttributeValue("clientport", cty.NumberIntVal(config.ClientPort))
routerBody1.SetAttributeValue("routerport", cty.NumberIntVal(config.RouterPort))
routerBody1.SetAttributeValue("workerport", cty.NumberIntVal(config.WorkerPort))
routerBody1.SetAttributeValue("clientport", cty.NumberIntVal(int64(config.ClientPort)))
routerBody1.SetAttributeValue("routerport", cty.NumberIntVal(int64(config.RouterPort)))
routerBody1.SetAttributeValue("workerport", cty.NumberIntVal(int64(config.WorkerPort)))
rootBody.AppendNewline()
workerBlock1 := rootBody.AppendNewBlock("worker", []string{config.Name})