forked from wtg/shuttletracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstop.go
29 lines (24 loc) · 746 Bytes
/
stop.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
package shuttletracker
import (
"errors"
"time"
)
// Stop is a place where vehicles frequently stop.
type Stop struct {
ID int64 `json:"id"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
// Name and Description are pointers because they may be nil.
Name *string `json:"name"`
Description *string `json:"description"`
}
// StopService is an interface for interacting with Stops.
type StopService interface {
Stops() ([]*Stop, error)
CreateStop(stop *Stop) error
DeleteStop(id int64) error
}
// ErrStopNotFound indicates that a Stop is not in the service.
var ErrStopNotFound = errors.New("Stop not found")