From e12299ac20aedc72baa133d0c7ce9e47bd1970d1 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Tue, 11 Jan 2022 08:16:02 -0500 Subject: [PATCH] add config name for identifying who wants what --- broker/job.go | 4 +++- config.json | 1 + config/config.go | 1 + todo.yaml | 4 +++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/broker/job.go b/broker/job.go index 27abf3d..8666a37 100644 --- a/broker/job.go +++ b/broker/job.go @@ -2,6 +2,7 @@ package broker import ( "fmt" + "local/truckstop/config" "time" ) @@ -37,7 +38,8 @@ func (j JobLocation) String() string { func (j Job) FormatMultilineText() string { return fmt.Sprintf( - "--- %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s", + "--- %s: %s => %s ---\nPickup: %s\nDropoff: %s\nNotes: %d lbs, %d miles, %s", + config.Get().Name, j.Pickup.State, j.Dropoff.State, j.Pickup.String(), diff --git a/config.json b/config.json index d593d38..00fabe0 100644 --- a/config.json +++ b/config.json @@ -1,4 +1,5 @@ { + "Name": "pa", "Interval": { "OK": "6h0m0s", "Error": "6h", diff --git a/config/config.go b/config/config.go index fbdfeb2..54b2c4f 100644 --- a/config/config.go +++ b/config/config.go @@ -10,6 +10,7 @@ import ( ) type Config struct { + Name string Interval struct { Email Duration OK Duration diff --git a/todo.yaml b/todo.yaml index d81f141..137f6a5 100644 --- a/todo.yaml +++ b/todo.yaml @@ -3,9 +3,11 @@ todo: subtasks: - banlist criteria like vendors, brokers, metadata - quiet hours -- setup pa on element +- setup ma on element - accept states via element for one system +- set up copy for caleb, broc done: +- setup pa on element - configurable email interval - jitter on intervals, including dedicated err span - email doesnt get all matches