From c8d8bad0393a8cd38b02f029dab833068b285ce0 Mon Sep 17 00:00:00 2001 From: CoderBear801 Date: Tue, 21 Jan 2020 10:28:09 -0800 Subject: [PATCH] feat: implement osrm table response issue: https://github.com/Telenav/osrm-backend/issues/137 --- integration/pkg/api/osrm/table/response.go | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/integration/pkg/api/osrm/table/response.go b/integration/pkg/api/osrm/table/response.go index eff5472eafe..462b5bc17ce 100644 --- a/integration/pkg/api/osrm/table/response.go +++ b/integration/pkg/api/osrm/table/response.go @@ -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 +}