mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-15 04:24:44 +00:00
55 lines
1.3 KiB
Protocol Buffer
55 lines
1.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package places;
|
|
option go_package = "./proto;places";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
import "google/protobuf/wrappers.proto";
|
|
|
|
service Places {
|
|
// Save a set of places
|
|
rpc Save(SaveRequest) returns (SaveResponse) {}
|
|
// Last places for a set of users
|
|
rpc Last(LastRequest) returns (ListResponse) {}
|
|
// Near returns the places near a point at a given time
|
|
rpc Near(NearRequest) returns (ListResponse) {}
|
|
// Read places for a group of users between two points in time
|
|
rpc Read(ReadRequest) returns (ListResponse) {}
|
|
}
|
|
|
|
message Location {
|
|
string id = 1;
|
|
string name = 2;
|
|
map<string,string> metadata = 3;
|
|
google.protobuf.Timestamp timestamp = 4;
|
|
google.protobuf.DoubleValue latitude = 5;
|
|
google.protobuf.DoubleValue longitude = 6;
|
|
}
|
|
|
|
message SaveRequest {
|
|
repeated Location places = 1;
|
|
}
|
|
|
|
message SaveResponse {}
|
|
|
|
message LastRequest {
|
|
repeated string ids = 1;
|
|
}
|
|
|
|
message ListResponse {
|
|
repeated Location places = 1;
|
|
}
|
|
|
|
message NearRequest {
|
|
google.protobuf.DoubleValue latitude = 1;
|
|
google.protobuf.DoubleValue longitude = 2;
|
|
// radius to search within, units km
|
|
google.protobuf.DoubleValue radius = 3;
|
|
}
|
|
|
|
message ReadRequest {
|
|
repeated string ids = 1;
|
|
google.protobuf.Timestamp after = 2;
|
|
google.protobuf.Timestamp before = 3;
|
|
}
|