mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-22 23:35:26 +00:00
ETAs Service (#31)
This commit is contained in:
439
etas/proto/etas.pb.go
Normal file
439
etas/proto/etas.pb.go
Normal file
@@ -0,0 +1,439 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.23.0
|
||||
// protoc v3.13.0
|
||||
// source: proto/etas.proto
|
||||
|
||||
package etas
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type Point struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// id for the point, this is returned in the response with additional information such as estimated
|
||||
// arrival time and estimated departure time.
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
// the latitude for the point
|
||||
Latitude float64 `protobuf:"fixed64,2,opt,name=latitude,proto3" json:"latitude,omitempty"`
|
||||
// the longitude for the point
|
||||
Longitude float64 `protobuf:"fixed64,3,opt,name=longitude,proto3" json:"longitude,omitempty"`
|
||||
// the estimated time the vehicle will spend at the point between arrival and departure (unit
|
||||
// minutes).
|
||||
WaitTime int32 `protobuf:"varint,4,opt,name=wait_time,json=waitTime,proto3" json:"wait_time,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Point) Reset() {
|
||||
*x = Point{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_etas_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Point) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Point) ProtoMessage() {}
|
||||
|
||||
func (x *Point) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_etas_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Point.ProtoReflect.Descriptor instead.
|
||||
func (*Point) Descriptor() ([]byte, []int) {
|
||||
return file_proto_etas_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Point) GetId() string {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Point) GetLatitude() float64 {
|
||||
if x != nil {
|
||||
return x.Latitude
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Point) GetLongitude() float64 {
|
||||
if x != nil {
|
||||
return x.Longitude
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Point) GetWaitTime() int32 {
|
||||
if x != nil {
|
||||
return x.WaitTime
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// pickup is where the route must start, e.g. a depot
|
||||
Pickup *Point `protobuf:"bytes,1,opt,name=pickup,proto3" json:"pickup,omitempty"`
|
||||
// waypoints are points the vehicle must pass on their route
|
||||
Waypoints []*Point `protobuf:"bytes,2,rep,name=waypoints,proto3" json:"waypoints,omitempty"`
|
||||
// start time specifies the time the vehicle will arrive at the pickup. If no value is provided,
|
||||
// the current time will be used
|
||||
StartTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Route) Reset() {
|
||||
*x = Route{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_etas_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Route) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Route) ProtoMessage() {}
|
||||
|
||||
func (x *Route) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_etas_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Route.ProtoReflect.Descriptor instead.
|
||||
func (*Route) Descriptor() ([]byte, []int) {
|
||||
return file_proto_etas_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Route) GetPickup() *Point {
|
||||
if x != nil {
|
||||
return x.Pickup
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Route) GetWaypoints() []*Point {
|
||||
if x != nil {
|
||||
return x.Waypoints
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Route) GetStartTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.StartTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// points contains the ETAs for each point. The first point will be the pickup and the subsequent
|
||||
// points are the waypoints
|
||||
Points map[string]*ETA `protobuf:"bytes,1,rep,name=points,proto3" json:"points,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (x *Response) Reset() {
|
||||
*x = Response{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_etas_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Response) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Response) ProtoMessage() {}
|
||||
|
||||
func (x *Response) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_etas_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Response.ProtoReflect.Descriptor instead.
|
||||
func (*Response) Descriptor() ([]byte, []int) {
|
||||
return file_proto_etas_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Response) GetPoints() map[string]*ETA {
|
||||
if x != nil {
|
||||
return x.Points
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ETA struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
EstimatedArrivalTime *timestamp.Timestamp `protobuf:"bytes,1,opt,name=estimated_arrival_time,json=estimatedArrivalTime,proto3" json:"estimated_arrival_time,omitempty"`
|
||||
EstimatedDepartureTime *timestamp.Timestamp `protobuf:"bytes,2,opt,name=estimated_departure_time,json=estimatedDepartureTime,proto3" json:"estimated_departure_time,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ETA) Reset() {
|
||||
*x = ETA{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_proto_etas_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ETA) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ETA) ProtoMessage() {}
|
||||
|
||||
func (x *ETA) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_proto_etas_proto_msgTypes[3]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ETA.ProtoReflect.Descriptor instead.
|
||||
func (*ETA) Descriptor() ([]byte, []int) {
|
||||
return file_proto_etas_proto_rawDescGZIP(), []int{3}
|
||||
}
|
||||
|
||||
func (x *ETA) GetEstimatedArrivalTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.EstimatedArrivalTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ETA) GetEstimatedDepartureTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.EstimatedDepartureTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_proto_etas_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_proto_etas_proto_rawDesc = []byte{
|
||||
0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x12, 0x04, 0x65, 0x74, 0x61, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
||||
0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6e, 0x0a, 0x05, 0x50, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
||||
0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c,
|
||||
0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||
0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09,
|
||||
0x77, 0x61, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
|
||||
0x08, 0x77, 0x61, 0x69, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x05, 0x52, 0x6f,
|
||||
0x75, 0x74, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x74, 0x61, 0x73, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74,
|
||||
0x52, 0x06, 0x70, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x29, 0x0a, 0x09, 0x77, 0x61, 0x79, 0x70,
|
||||
0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x65, 0x74,
|
||||
0x61, 0x73, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x77, 0x61, 0x79, 0x70, 0x6f, 0x69,
|
||||
0x6e, 0x74, 0x73, 0x12, 0x39, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
||||
0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x84,
|
||||
0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x70,
|
||||
0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x74,
|
||||
0x61, 0x73, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x6f, 0x69, 0x6e,
|
||||
0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x1a,
|
||||
0x44, 0x0a, 0x0b, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
|
||||
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
|
||||
0x12, 0x1f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x09, 0x2e, 0x65, 0x74, 0x61, 0x73, 0x2e, 0x45, 0x54, 0x41, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xad, 0x01, 0x0a, 0x03, 0x45, 0x54, 0x41, 0x12, 0x50, 0x0a,
|
||||
0x16, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x72, 0x72, 0x69, 0x76,
|
||||
0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x14, 0x65, 0x73, 0x74, 0x69, 0x6d,
|
||||
0x61, 0x74, 0x65, 0x64, 0x41, 0x72, 0x72, 0x69, 0x76, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||
0x54, 0x0a, 0x18, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x70,
|
||||
0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x16, 0x65,
|
||||
0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72,
|
||||
0x65, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x30, 0x0a, 0x04, 0x45, 0x54, 0x41, 0x73, 0x12, 0x28, 0x0a,
|
||||
0x09, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x2e, 0x65, 0x74, 0x61,
|
||||
0x73, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x1a, 0x0e, 0x2e, 0x65, 0x74, 0x61, 0x73, 0x2e, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75,
|
||||
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||
0x69, 0x63, 0x65, 0x73, 0x2f, 0x65, 0x74, 0x61, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b,
|
||||
0x65, 0x74, 0x61, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_proto_etas_proto_rawDescOnce sync.Once
|
||||
file_proto_etas_proto_rawDescData = file_proto_etas_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_proto_etas_proto_rawDescGZIP() []byte {
|
||||
file_proto_etas_proto_rawDescOnce.Do(func() {
|
||||
file_proto_etas_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_etas_proto_rawDescData)
|
||||
})
|
||||
return file_proto_etas_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_proto_etas_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_proto_etas_proto_goTypes = []interface{}{
|
||||
(*Point)(nil), // 0: etas.Point
|
||||
(*Route)(nil), // 1: etas.Route
|
||||
(*Response)(nil), // 2: etas.Response
|
||||
(*ETA)(nil), // 3: etas.ETA
|
||||
nil, // 4: etas.Response.PointsEntry
|
||||
(*timestamp.Timestamp)(nil), // 5: google.protobuf.Timestamp
|
||||
}
|
||||
var file_proto_etas_proto_depIdxs = []int32{
|
||||
0, // 0: etas.Route.pickup:type_name -> etas.Point
|
||||
0, // 1: etas.Route.waypoints:type_name -> etas.Point
|
||||
5, // 2: etas.Route.start_time:type_name -> google.protobuf.Timestamp
|
||||
4, // 3: etas.Response.points:type_name -> etas.Response.PointsEntry
|
||||
5, // 4: etas.ETA.estimated_arrival_time:type_name -> google.protobuf.Timestamp
|
||||
5, // 5: etas.ETA.estimated_departure_time:type_name -> google.protobuf.Timestamp
|
||||
3, // 6: etas.Response.PointsEntry.value:type_name -> etas.ETA
|
||||
1, // 7: etas.ETAs.Calculate:input_type -> etas.Route
|
||||
2, // 8: etas.ETAs.Calculate:output_type -> etas.Response
|
||||
8, // [8:9] is the sub-list for method output_type
|
||||
7, // [7:8] is the sub-list for method input_type
|
||||
7, // [7:7] is the sub-list for extension type_name
|
||||
7, // [7:7] is the sub-list for extension extendee
|
||||
0, // [0:7] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_proto_etas_proto_init() }
|
||||
func file_proto_etas_proto_init() {
|
||||
if File_proto_etas_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_proto_etas_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Point); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_etas_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Route); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_etas_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Response); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_proto_etas_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ETA); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_proto_etas_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 5,
|
||||
NumExtensions: 0,
|
||||
NumServices: 1,
|
||||
},
|
||||
GoTypes: file_proto_etas_proto_goTypes,
|
||||
DependencyIndexes: file_proto_etas_proto_depIdxs,
|
||||
MessageInfos: file_proto_etas_proto_msgTypes,
|
||||
}.Build()
|
||||
File_proto_etas_proto = out.File
|
||||
file_proto_etas_proto_rawDesc = nil
|
||||
file_proto_etas_proto_goTypes = nil
|
||||
file_proto_etas_proto_depIdxs = nil
|
||||
}
|
||||
94
etas/proto/etas.pb.micro.go
Normal file
94
etas/proto/etas.pb.micro.go
Normal file
@@ -0,0 +1,94 @@
|
||||
// Code generated by protoc-gen-micro. DO NOT EDIT.
|
||||
// source: proto/etas.proto
|
||||
|
||||
package etas
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/golang/protobuf/ptypes/timestamp"
|
||||
math "math"
|
||||
)
|
||||
|
||||
import (
|
||||
context "context"
|
||||
api "github.com/micro/micro/v3/service/api"
|
||||
client "github.com/micro/micro/v3/service/client"
|
||||
server "github.com/micro/micro/v3/service/server"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ api.Endpoint
|
||||
var _ context.Context
|
||||
var _ client.Option
|
||||
var _ server.Option
|
||||
|
||||
// Api Endpoints for ETAs service
|
||||
|
||||
func NewETAsEndpoints() []*api.Endpoint {
|
||||
return []*api.Endpoint{}
|
||||
}
|
||||
|
||||
// Client API for ETAs service
|
||||
|
||||
type ETAsService interface {
|
||||
Calculate(ctx context.Context, in *Route, opts ...client.CallOption) (*Response, error)
|
||||
}
|
||||
|
||||
type eTAsService struct {
|
||||
c client.Client
|
||||
name string
|
||||
}
|
||||
|
||||
func NewETAsService(name string, c client.Client) ETAsService {
|
||||
return &eTAsService{
|
||||
c: c,
|
||||
name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *eTAsService) Calculate(ctx context.Context, in *Route, opts ...client.CallOption) (*Response, error) {
|
||||
req := c.c.NewRequest(c.name, "ETAs.Calculate", in)
|
||||
out := new(Response)
|
||||
err := c.c.Call(ctx, req, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// Server API for ETAs service
|
||||
|
||||
type ETAsHandler interface {
|
||||
Calculate(context.Context, *Route, *Response) error
|
||||
}
|
||||
|
||||
func RegisterETAsHandler(s server.Server, hdlr ETAsHandler, opts ...server.HandlerOption) error {
|
||||
type eTAs interface {
|
||||
Calculate(ctx context.Context, in *Route, out *Response) error
|
||||
}
|
||||
type ETAs struct {
|
||||
eTAs
|
||||
}
|
||||
h := &eTAsHandler{hdlr}
|
||||
return s.Handle(s.NewHandler(&ETAs{h}, opts...))
|
||||
}
|
||||
|
||||
type eTAsHandler struct {
|
||||
ETAsHandler
|
||||
}
|
||||
|
||||
func (h *eTAsHandler) Calculate(ctx context.Context, in *Route, out *Response) error {
|
||||
return h.ETAsHandler.Calculate(ctx, in, out)
|
||||
}
|
||||
44
etas/proto/etas.proto
Normal file
44
etas/proto/etas.proto
Normal file
@@ -0,0 +1,44 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package etas;
|
||||
option go_package = "github.com/micro/services/etas/proto;etas";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
service ETAs {
|
||||
rpc Calculate(Route) returns (Response);
|
||||
}
|
||||
|
||||
message Point {
|
||||
// id for the point, this is returned in the response with additional information such as estimated
|
||||
// arrival time and estimated departure time.
|
||||
string id = 1;
|
||||
// the latitude for the point
|
||||
double latitude = 2;
|
||||
// the longitude for the point
|
||||
double longitude = 3;
|
||||
// the estimated time the vehicle will spend at the point between arrival and departure (unit
|
||||
// minutes).
|
||||
int32 wait_time = 4;
|
||||
}
|
||||
|
||||
message Route {
|
||||
// pickup is where the route must start, e.g. a depot
|
||||
Point pickup = 1;
|
||||
// waypoints are points the vehicle must pass on their route
|
||||
repeated Point waypoints = 2;
|
||||
// start time specifies the time the vehicle will arrive at the pickup. If no value is provided,
|
||||
// the current time will be used
|
||||
google.protobuf.Timestamp start_time = 3;
|
||||
}
|
||||
|
||||
message Response {
|
||||
// points contains the ETAs for each point. The first point will be the pickup and the subsequent
|
||||
// points are the waypoints
|
||||
map<string,ETA> points = 1;
|
||||
}
|
||||
|
||||
message ETA {
|
||||
google.protobuf.Timestamp estimated_arrival_time = 1;
|
||||
google.protobuf.Timestamp estimated_departure_time = 2;
|
||||
}
|
||||
Reference in New Issue
Block a user