parse ntg jobs and strigify them
This commit is contained in:
34
broker/job.go
Normal file
34
broker/job.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package broker
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Job struct {
|
||||
ID string
|
||||
Pickup JobLocation
|
||||
Dropoff JobLocation
|
||||
Weight int
|
||||
Meta string
|
||||
}
|
||||
|
||||
type JobLocation struct {
|
||||
Date time.Time
|
||||
City string
|
||||
State string
|
||||
}
|
||||
|
||||
func (j Job) String() string {
|
||||
return fmt.Sprintf(
|
||||
`%s => %s, Weight:%d, Notes:%s`,
|
||||
j.Pickup.String(),
|
||||
j.Dropoff.String(),
|
||||
j.Weight,
|
||||
j.Meta,
|
||||
)
|
||||
}
|
||||
|
||||
func (j JobLocation) String() string {
|
||||
return fmt.Sprintf("%s, %s @ %s", j.City, j.State, j.Date.Format("Monday Jan 02"))
|
||||
}
|
||||
Reference in New Issue
Block a user