truckstop/broker/job.go

35 lines
508 B
Go

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"))
}