Documentation ¶
Index ¶
- Variables
- func RegisterIngestServiceServer(s grpc.ServiceRegistrar, srv IngestServiceServer)
- type Acceleration
- func (*Acceleration) Descriptor() ([]byte, []int)deprecated
- func (x *Acceleration) GetX() float64
- func (x *Acceleration) GetY() float64
- func (x *Acceleration) GetZ() float64
- func (*Acceleration) ProtoMessage()
- func (x *Acceleration) ProtoReflect() protoreflect.Message
- func (x *Acceleration) Reset()
- func (x *Acceleration) String() string
- type BatchInsertRequest
- func (*BatchInsertRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BatchInsertRequest) GetEvents() []*PositionEvent
- func (*BatchInsertRequest) ProtoMessage()
- func (x *BatchInsertRequest) ProtoReflect() protoreflect.Message
- func (x *BatchInsertRequest) Reset()
- func (x *BatchInsertRequest) String() string
- type BatchInsertResponse
- func (*BatchInsertResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BatchInsertResponse) GetErrors() []*InsertError
- func (*BatchInsertResponse) ProtoMessage()
- func (x *BatchInsertResponse) ProtoReflect() protoreflect.Message
- func (x *BatchInsertResponse) Reset()
- func (x *BatchInsertResponse) String() string
- type Gyro
- type IngestServiceClient
- type IngestServiceServer
- type InsertError
- func (*InsertError) Descriptor() ([]byte, []int)deprecated
- func (x *InsertError) GetError() *status.Status
- func (x *InsertError) GetIndex() int32
- func (*InsertError) ProtoMessage()
- func (x *InsertError) ProtoReflect() protoreflect.Message
- func (x *InsertError) Reset()
- func (x *InsertError) String() string
- type Position
- func (*Position) Descriptor() ([]byte, []int)deprecated
- func (x *Position) GetBearing() float64
- func (x *Position) GetLatlng() *geo.LatLng
- func (x *Position) GetSpeed() float64
- func (*Position) ProtoMessage()
- func (x *Position) ProtoReflect() protoreflect.Message
- func (x *Position) Reset()
- func (x *Position) String() string
- type PositionEvent
- func (*PositionEvent) Descriptor() ([]byte, []int)deprecated
- func (x *PositionEvent) GetAcceleration() *Acceleration
- func (x *PositionEvent) GetGyro() *Gyro
- func (x *PositionEvent) GetLabels() map[string]string
- func (x *PositionEvent) GetPosition() *Position
- func (x *PositionEvent) GetTimestamp() *timestamppb.Timestamp
- func (x *PositionEvent) GetTransportType() TransportType
- func (x *PositionEvent) GetTripId() string
- func (x *PositionEvent) GetVehicleId() string
- func (x *PositionEvent) GetVehicleType() VehicleType
- func (*PositionEvent) ProtoMessage()
- func (x *PositionEvent) ProtoReflect() protoreflect.Message
- func (x *PositionEvent) Reset()
- func (x *PositionEvent) String() string
- type TransportType
- func (TransportType) Descriptor() protoreflect.EnumDescriptor
- func (x TransportType) Enum() *TransportType
- func (TransportType) EnumDescriptor() ([]byte, []int)deprecated
- func (x TransportType) Number() protoreflect.EnumNumber
- func (x TransportType) String() string
- func (TransportType) Type() protoreflect.EnumType
- type UnimplementedIngestServiceServer
- type UnsafeIngestServiceServer
- type VehicleType
- func (VehicleType) Descriptor() protoreflect.EnumDescriptor
- func (x VehicleType) Enum() *VehicleType
- func (VehicleType) EnumDescriptor() ([]byte, []int)deprecated
- func (x VehicleType) Number() protoreflect.EnumNumber
- func (x VehicleType) String() string
- func (VehicleType) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( TransportType_name = map[int32]string{ 0: "TRANSPORT_TYPE_UNSPECIFIED", 1: "PRIVATE", 2: "PUBLIC", } TransportType_value = map[string]int32{ "TRANSPORT_TYPE_UNSPECIFIED": 0, "PRIVATE": 1, "PUBLIC": 2, } )
Enum value maps for TransportType.
var ( VehicleType_name = map[int32]string{ 0: "VEHICLE_TYPE_UNSPECIFIED", 1: "BUS", 2: "CAR", 3: "VAN", 4: "TRUCK", } VehicleType_value = map[string]int32{ "VEHICLE_TYPE_UNSPECIFIED": 0, "BUS": 1, "CAR": 2, "VAN": 3, "TRUCK": 4, } )
Enum value maps for VehicleType.
var File_compass_harvest_v1alpha1_ingest_proto protoreflect.FileDescriptor
var File_compass_harvest_v1alpha1_position_event_proto protoreflect.FileDescriptor
var IngestService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "compass.harvest.v1alpha1.IngestService", HandlerType: (*IngestServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Insert", Handler: _IngestService_Insert_Handler, }, { MethodName: "BatchInsert", Handler: _IngestService_BatchInsert_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "compass/harvest/v1alpha1/ingest.proto", }
IngestService_ServiceDesc is the grpc.ServiceDesc for IngestService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterIngestServiceServer ¶
func RegisterIngestServiceServer(s grpc.ServiceRegistrar, srv IngestServiceServer)
Types ¶
type Acceleration ¶
type Acceleration struct { X float64 `protobuf:"fixed64,1,opt,name=x,proto3" json:"x,omitempty"` // acceleration / braking Y float64 `protobuf:"fixed64,2,opt,name=y,proto3" json:"y,omitempty"` // side to side / turning force Z float64 `protobuf:"fixed64,3,opt,name=z,proto3" json:"z,omitempty"` // vertical up / down force // contains filtered or unexported fields }
* Acceleration is measured in gforce so if the vehicle is accelerating at 9.8m/s^2 (newtons) in the x axis, the input to this api should be Acceleration { 1, 0, 0 } if it is decelerating at 1m/s^2, the input to this api should be { -0.102, 0, 0 } (0.102 ~= 1/9.8) if this is confusing, don't worry to hard about getting it correct, we can apply provider specific unit conversions post ingestion, just be consistent and let us know Note that the vertical axis in the diagram is the z axis, not the y axis Also note the + and - signs in the diagram which direction should be positive and negative within each axis
![alt text](https://storage.googleapis.com/compass-public-docs/static/acc_gyro.png)
func (*Acceleration) Descriptor
deprecated
func (*Acceleration) Descriptor() ([]byte, []int)
Deprecated: Use Acceleration.ProtoReflect.Descriptor instead.
func (*Acceleration) GetX ¶
func (x *Acceleration) GetX() float64
func (*Acceleration) GetY ¶
func (x *Acceleration) GetY() float64
func (*Acceleration) GetZ ¶
func (x *Acceleration) GetZ() float64
func (*Acceleration) ProtoMessage ¶
func (*Acceleration) ProtoMessage()
func (*Acceleration) ProtoReflect ¶
func (x *Acceleration) ProtoReflect() protoreflect.Message
func (*Acceleration) Reset ¶
func (x *Acceleration) Reset()
func (*Acceleration) String ¶
func (x *Acceleration) String() string
type BatchInsertRequest ¶
type BatchInsertRequest struct { Events []*PositionEvent `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` // contains filtered or unexported fields }
* Batch request for sending multiple events in a single call please don't go crazy on the message size !
func (*BatchInsertRequest) Descriptor
deprecated
func (*BatchInsertRequest) Descriptor() ([]byte, []int)
Deprecated: Use BatchInsertRequest.ProtoReflect.Descriptor instead.
func (*BatchInsertRequest) GetEvents ¶
func (x *BatchInsertRequest) GetEvents() []*PositionEvent
func (*BatchInsertRequest) ProtoMessage ¶
func (*BatchInsertRequest) ProtoMessage()
func (*BatchInsertRequest) ProtoReflect ¶
func (x *BatchInsertRequest) ProtoReflect() protoreflect.Message
func (*BatchInsertRequest) Reset ¶
func (x *BatchInsertRequest) Reset()
func (*BatchInsertRequest) String ¶
func (x *BatchInsertRequest) String() string
type BatchInsertResponse ¶
type BatchInsertResponse struct { Errors []*InsertError `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` // contains filtered or unexported fields }
* List of errors ordered according to the BatchInsertRequest
func (*BatchInsertResponse) Descriptor
deprecated
func (*BatchInsertResponse) Descriptor() ([]byte, []int)
Deprecated: Use BatchInsertResponse.ProtoReflect.Descriptor instead.
func (*BatchInsertResponse) GetErrors ¶
func (x *BatchInsertResponse) GetErrors() []*InsertError
func (*BatchInsertResponse) ProtoMessage ¶
func (*BatchInsertResponse) ProtoMessage()
func (*BatchInsertResponse) ProtoReflect ¶
func (x *BatchInsertResponse) ProtoReflect() protoreflect.Message
func (*BatchInsertResponse) Reset ¶
func (x *BatchInsertResponse) Reset()
func (*BatchInsertResponse) String ¶
func (x *BatchInsertResponse) String() string
type Gyro ¶
type Gyro struct { Roll float64 `protobuf:"fixed64,1,opt,name=roll,proto3" json:"roll,omitempty"` Pitch float64 `protobuf:"fixed64,2,opt,name=pitch,proto3" json:"pitch,omitempty"` Yaw float64 `protobuf:"fixed64,3,opt,name=yaw,proto3" json:"yaw,omitempty"` // contains filtered or unexported fields }
* Rotational data is measured in degrees per second A positive value for roll, pitch or yaw is defined in the anti-clockwise direction when facing the positive direction of it's axis
See acceleration diagram for more details
func (*Gyro) Descriptor
deprecated
func (*Gyro) ProtoMessage ¶
func (*Gyro) ProtoMessage()
func (*Gyro) ProtoReflect ¶
func (x *Gyro) ProtoReflect() protoreflect.Message
type IngestServiceClient ¶
type IngestServiceClient interface { Insert(ctx context.Context, in *PositionEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) BatchInsert(ctx context.Context, in *BatchInsertRequest, opts ...grpc.CallOption) (*BatchInsertResponse, error) }
IngestServiceClient is the client API for IngestService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewIngestServiceClient ¶
func NewIngestServiceClient(cc grpc.ClientConnInterface) IngestServiceClient
type IngestServiceServer ¶
type IngestServiceServer interface { Insert(context.Context, *PositionEvent) (*emptypb.Empty, error) BatchInsert(context.Context, *BatchInsertRequest) (*BatchInsertResponse, error) // contains filtered or unexported methods }
IngestServiceServer is the server API for IngestService service. All implementations must embed UnimplementedIngestServiceServer for forward compatibility
type InsertError ¶
type InsertError struct { Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` Error *status.Status `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
e.g. if BatchInsertRequest.events[2] contains an error BatchInsertResponse.errors.index = 2 should contain the relevant message
func (*InsertError) Descriptor
deprecated
func (*InsertError) Descriptor() ([]byte, []int)
Deprecated: Use InsertError.ProtoReflect.Descriptor instead.
func (*InsertError) GetError ¶
func (x *InsertError) GetError() *status.Status
func (*InsertError) GetIndex ¶
func (x *InsertError) GetIndex() int32
func (*InsertError) ProtoMessage ¶
func (*InsertError) ProtoMessage()
func (*InsertError) ProtoReflect ¶
func (x *InsertError) ProtoReflect() protoreflect.Message
func (*InsertError) Reset ¶
func (x *InsertError) Reset()
func (*InsertError) String ¶
func (x *InsertError) String() string
type Position ¶
type Position struct { Latlng *geo.LatLng `protobuf:"bytes,1,opt,name=latlng,proto3" json:"latlng,omitempty"` // lat and lng of the vehicle position Speed float64 `protobuf:"fixed64,2,opt,name=speed,proto3" json:"speed,omitempty"` // speed of vehicle in km/h Bearing float64 `protobuf:"fixed64,3,opt,name=bearing,proto3" json:"bearing,omitempty"` // [optional] bearing of vehicle in degrees [0, 360) // contains filtered or unexported fields }
func (*Position) Descriptor
deprecated
func (*Position) GetBearing ¶
func (*Position) ProtoMessage ¶
func (*Position) ProtoMessage()
func (*Position) ProtoReflect ¶
func (x *Position) ProtoReflect() protoreflect.Message
type PositionEvent ¶
type PositionEvent struct { VehicleId string `protobuf:"bytes,1,opt,name=vehicle_id,json=vehicleId,proto3" json:"vehicle_id,omitempty"` // Unique identifier for the vehicle. device_id is a sufficiently good proxy for this field Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp that event occured TransportType TransportType `` /* 145-byte string literal not displayed */ VehicleType VehicleType `` /* 137-byte string literal not displayed */ Position *Position `protobuf:"bytes,5,opt,name=position,proto3" json:"position,omitempty"` Acceleration *Acceleration `protobuf:"bytes,7,opt,name=acceleration,proto3" json:"acceleration,omitempty"` Gyro *Gyro `protobuf:"bytes,8,opt,name=gyro,proto3" json:"gyro,omitempty"` TripId string `protobuf:"bytes,9,opt,name=trip_id,json=tripId,proto3" json:"trip_id,omitempty"` // Id linking points of the same trip Labels map[string]string `` // extra metadata not suppported by our api that may be useful :) /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
* - Either VehicleID or TripID MUST be present. - Ideally both, followed by just VehicleID, followed by just TripID. - Position, VehicleType and TransportType are required - Any extra metadata can be added in 'labels' and will be greatly appreciated!
func (*PositionEvent) Descriptor
deprecated
func (*PositionEvent) Descriptor() ([]byte, []int)
Deprecated: Use PositionEvent.ProtoReflect.Descriptor instead.
func (*PositionEvent) GetAcceleration ¶
func (x *PositionEvent) GetAcceleration() *Acceleration
func (*PositionEvent) GetGyro ¶
func (x *PositionEvent) GetGyro() *Gyro
func (*PositionEvent) GetLabels ¶
func (x *PositionEvent) GetLabels() map[string]string
func (*PositionEvent) GetPosition ¶
func (x *PositionEvent) GetPosition() *Position
func (*PositionEvent) GetTimestamp ¶
func (x *PositionEvent) GetTimestamp() *timestamppb.Timestamp
func (*PositionEvent) GetTransportType ¶
func (x *PositionEvent) GetTransportType() TransportType
func (*PositionEvent) GetTripId ¶
func (x *PositionEvent) GetTripId() string
func (*PositionEvent) GetVehicleId ¶
func (x *PositionEvent) GetVehicleId() string
func (*PositionEvent) GetVehicleType ¶
func (x *PositionEvent) GetVehicleType() VehicleType
func (*PositionEvent) ProtoMessage ¶
func (*PositionEvent) ProtoMessage()
func (*PositionEvent) ProtoReflect ¶
func (x *PositionEvent) ProtoReflect() protoreflect.Message
func (*PositionEvent) Reset ¶
func (x *PositionEvent) Reset()
func (*PositionEvent) String ¶
func (x *PositionEvent) String() string
type TransportType ¶
type TransportType int32
const ( TransportType_TRANSPORT_TYPE_UNSPECIFIED TransportType = 0 TransportType_PRIVATE TransportType = 1 // Anything not public TransportType_PUBLIC TransportType = 2 // Vehicle operated by public services )
func (TransportType) Descriptor ¶
func (TransportType) Descriptor() protoreflect.EnumDescriptor
func (TransportType) Enum ¶
func (x TransportType) Enum() *TransportType
func (TransportType) EnumDescriptor
deprecated
func (TransportType) EnumDescriptor() ([]byte, []int)
Deprecated: Use TransportType.Descriptor instead.
func (TransportType) Number ¶
func (x TransportType) Number() protoreflect.EnumNumber
func (TransportType) String ¶
func (x TransportType) String() string
func (TransportType) Type ¶
func (TransportType) Type() protoreflect.EnumType
type UnimplementedIngestServiceServer ¶
type UnimplementedIngestServiceServer struct { }
UnimplementedIngestServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedIngestServiceServer) BatchInsert ¶
func (UnimplementedIngestServiceServer) BatchInsert(context.Context, *BatchInsertRequest) (*BatchInsertResponse, error)
func (UnimplementedIngestServiceServer) Insert ¶
func (UnimplementedIngestServiceServer) Insert(context.Context, *PositionEvent) (*emptypb.Empty, error)
type UnsafeIngestServiceServer ¶
type UnsafeIngestServiceServer interface {
// contains filtered or unexported methods
}
UnsafeIngestServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to IngestServiceServer will result in compilation errors.
type VehicleType ¶
type VehicleType int32
const ( VehicleType_VEHICLE_TYPE_UNSPECIFIED VehicleType = 0 VehicleType_BUS VehicleType = 1 VehicleType_CAR VehicleType = 2 VehicleType_VAN VehicleType = 3 VehicleType_TRUCK VehicleType = 4 )
func (VehicleType) Descriptor ¶
func (VehicleType) Descriptor() protoreflect.EnumDescriptor
func (VehicleType) Enum ¶
func (x VehicleType) Enum() *VehicleType
func (VehicleType) EnumDescriptor
deprecated
func (VehicleType) EnumDescriptor() ([]byte, []int)
Deprecated: Use VehicleType.Descriptor instead.
func (VehicleType) Number ¶
func (x VehicleType) Number() protoreflect.EnumNumber
func (VehicleType) String ¶
func (x VehicleType) String() string
func (VehicleType) Type ¶
func (VehicleType) Type() protoreflect.EnumType