forked from wtg/shuttletracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvehicle.go
30 lines (26 loc) · 844 Bytes
/
vehicle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package shuttletracker
import (
"errors"
"time"
)
// ErrVehicleNotFound indicates that a Vehicle is not in the service.
var ErrVehicleNotFound = errors.New("Vehicle not found")
// Vehicle represents an object being tracked.
type Vehicle struct {
ID int64 `json:"id"`
Name string `json:"name"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Enabled bool `json:"enabled"`
TrackerID string `json:"tracker_id"`
}
// VehicleService is an interface for interacting with Vehicles.
type VehicleService interface {
Vehicle(id int64) (*Vehicle, error)
VehicleWithTrackerID(id string) (*Vehicle, error)
Vehicles() ([]*Vehicle, error)
EnabledVehicles() ([]*Vehicle, error)
CreateVehicle(vehicle *Vehicle) error
DeleteVehicle(id int64) error
ModifyVehicle(vehicle *Vehicle) error
}