From 3d5f75522606fa4683385841904b532067a9cad7 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Fri, 11 Aug 2023 14:53:28 +0100 Subject: [PATCH] Size testing --- imaging/generate.go | 2 +- run/cli.go | 7 +++++++ run/common.go | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/imaging/generate.go b/imaging/generate.go index 80e4928..742ca87 100644 --- a/imaging/generate.go +++ b/imaging/generate.go @@ -2,7 +2,7 @@ package imaging import "image" -func Generate(height, width int, style, format string, data []LocationData) image.Image { +func Generate(height, width int, style, format string, data []string) image.Image { img := createCanvas(width, height) return img } diff --git a/run/cli.go b/run/cli.go index fd6a4ce..2c48a34 100644 --- a/run/cli.go +++ b/run/cli.go @@ -2,10 +2,15 @@ package run import ( "fmt" + "image" "os" + + "git.fjla.uk/fred.boniface/map-dots/imaging" + "git.fjla.uk/fred.boniface/map-dots/log" ) func CLI(height, width uint64, style, format, input string) { + log.Msg.Info("CLI Mode Started") fmt.Printf("Running CLI mode with height=%d, width=%d, type=%s, input=%s\n", height, width, style, input) fmt.Println("CLI Mode not implemented") @@ -18,6 +23,8 @@ func CLI(height, width uint64, style, format, input string) { // Check that `input` is a valid filepath and points to a valid file. // Use relevent package to parse file // Pass parsed data to imaging package + var testing []string + var _ image.Image = imaging.Generate(1, 1, "circle", "png", testing) fmt.Println("End of implementation") } diff --git a/run/common.go b/run/common.go index eb821e1..c888080 100644 --- a/run/common.go +++ b/run/common.go @@ -11,10 +11,13 @@ func envCheck() { log.Msg.Debug("reading Traccar credentials from environment") user := os.Getenv("TRACCAR_USER") pass := os.Getenv("TRACCAR_PASS") + url := os.Getenv("TRACCAR_URL") - if user == "" || pass == "" { + if user == "" || pass == "" || url == "" { fmt.Println("To use Traccar, you must set the environment variables:\n'TRACCAR_USER', 'TRACCAR_PASS', and for CLI use only 'TRACCAR_DEVID'") os.Stdout.Sync() // Flush the output buffer log.Msg.Fatal("Unable to read values from environment") } + + log.Msg.Debug("Traccar credentials exist in environment") }