Skip to content

Commit

Permalink
feat: implement osrm table response
Browse files Browse the repository at this point in the history
issue: #137
  • Loading branch information
CodeBear801 committed Feb 3, 2020
1 parent cd6777b commit c8d8bad
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions integration/pkg/api/osrm/table/response.go
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
package table

import "github.com/Telenav/osrm-backend/integration/pkg/api/osrm/route"

// Response represents OSRM api v1 table response.
type Response struct {
Code string `json:"code"`
Message string `json:"message,omitempty"`
Sources []*Source `json:"sources"`
Destinations []*Destination `json:"destinations"`
Durations []*Duration `json:"durations"`
Distances []*Distance `json:"distances"`
}

// Source represents as way point object. All sources will be listed in order.
type Source struct {
route.Waypoint
}

// Destination represents as way point object. All destination will be listed in order.
type Destination struct {
route.Waypoint
}

// Duration gives the travel time from specific source to all other destinations
type Duration struct {
Value []*float64
}

// Distance gives the travel distance from specific source to all other destinations
type Distance struct {
Value []*float64
}

0 comments on commit c8d8bad

Please sign in to comment.