mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-12-21 12:13:09 -05:00
Organize and document .proto files, no changes to request formats
This commit is contained in:
parent
0b2d849592
commit
9126d0ff13
7 changed files with 87 additions and 80 deletions
|
@ -1,21 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package weather;
|
|
||||||
|
|
||||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
|
||||||
|
|
||||||
//import "location_types.proto";
|
|
||||||
//import "units.proto"
|
|
||||||
|
|
||||||
message RequestCurrent {
|
|
||||||
//LocationType location_type = 1; NOT IMPLEMENTED YET
|
|
||||||
//Units units = 2; NOT IMPLEMENTED YET
|
|
||||||
string city = 1;
|
|
||||||
// optional string zip_code = 2; NOT IMPLEMENTED YET
|
|
||||||
// optional string state = 2; // US Only / NOT IMPLEMENTED YET
|
|
||||||
// optional string country = 3; // Must be an ISO 3166 code / NOT IMPLEMENTED YET
|
|
||||||
}
|
|
||||||
|
|
||||||
message SendCurrent {
|
|
||||||
string payload = 1;
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package weather;
|
|
||||||
|
|
||||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
|
||||||
|
|
||||||
//import "location_types.proto";
|
|
||||||
//import "units.proto"
|
|
||||||
|
|
||||||
message RequestExtended {
|
|
||||||
//LocationType location_type = 1; NOT IMPLEMENTED YET
|
|
||||||
//Units units = 2; NOT IMPLEMENTED YET
|
|
||||||
string city = 1;
|
|
||||||
// optional string zip_code = 2; NOT IMPLEMENTED YET
|
|
||||||
// optional string state = 2; // US Only / NOT IMPLEMENTED YET
|
|
||||||
// optional string country = 3; // Must be ISO 3166 code / NOT IMPLEMENTED YET
|
|
||||||
uint32 days = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message SendExtended {
|
|
||||||
string payload = 1;
|
|
||||||
}
|
|
|
@ -4,18 +4,37 @@ package weather;
|
||||||
|
|
||||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
||||||
|
|
||||||
//import "location_types.proto";
|
|
||||||
//import "units.proto"
|
//import "units.proto"
|
||||||
|
|
||||||
message RequestLocation {
|
// Sub-message used by Current & Extended for exact coordinates
|
||||||
//LocationType location_type = 1; NOT IMPLEMENTED YET
|
message Coordinates {
|
||||||
//Units units = 2; NOT IMPLEMENTED YET
|
float latitude = 1;
|
||||||
string city = 1;
|
float longitude = 2;
|
||||||
// optional string zip_code = 2; NOT IMPLEMENTED YET
|
|
||||||
// optional string state = 2; // US Only / NOT IMPLEMENTED YET
|
|
||||||
// optional string country = 3; // Must be an ISO 3166 code / NOT IMPLEMENTED YET
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used by Location, Current, and Extended to help the API find info for the
|
||||||
|
// correct location. If unspecified, an attept is still made but results may
|
||||||
|
// be inaccurate
|
||||||
|
enum LocationType {
|
||||||
|
LOCATION_TYPE_UNSPECIFIED = 0;
|
||||||
|
LOCATION_CITY = 1;
|
||||||
|
LOCATION_ZIP = 2;
|
||||||
|
LOCATION_COORDS = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the latitude and longitude for a given location
|
||||||
|
* Commented parameters in the message definition are not implemeneted yet
|
||||||
|
* location_type {enum} - name or value
|
||||||
|
* city {string} - case insensitive, spaces and punctuation allowed
|
||||||
|
* zip_code {string} - non-numeric values permitted
|
||||||
|
*/
|
||||||
|
message RequestLocation {
|
||||||
|
// LocationType location_type = 1;
|
||||||
|
string city = 1;
|
||||||
|
// optional string zip_code = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response to RequestLocation
|
||||||
message SendLocation {
|
message SendLocation {
|
||||||
float latitude = 1;
|
float latitude = 1;
|
||||||
float longitude = 2;
|
float longitude = 2;
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package weather;
|
|
||||||
|
|
||||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
|
||||||
|
|
||||||
enum LocationType {
|
|
||||||
LOCATION_TYPE_UNSPECIFIED = 0;
|
|
||||||
LOCATION_CITY = 1;
|
|
||||||
LOCATION_ZIP = 2;
|
|
||||||
LOCATION_COORDS = 3;
|
|
||||||
LOCATION_CITY_STATE = 4;
|
|
||||||
LOCATION_CITY_COUNTRY = 5;
|
|
||||||
LOCATION_ZIP_COUNTRY = 6;
|
|
||||||
}
|
|
|
@ -4,8 +4,7 @@ package weather;
|
||||||
|
|
||||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
||||||
|
|
||||||
import "current.proto";
|
import "weather.proto";
|
||||||
import "extended.proto";
|
|
||||||
import "location.proto";
|
import "location.proto";
|
||||||
|
|
||||||
service WeatherService {
|
service WeatherService {
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
package weather;
|
|
||||||
|
|
||||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
|
||||||
|
|
||||||
enum Units {
|
|
||||||
UNITS_UNSPECIFIED = 0;
|
|
||||||
UNITS_STANDARD = 1;
|
|
||||||
UNITS_METRIC = 2;
|
|
||||||
UNITS_IMPERIAL = 3;
|
|
||||||
}
|
|
59
proto/weather.proto
Normal file
59
proto/weather.proto
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package weather;
|
||||||
|
|
||||||
|
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
||||||
|
|
||||||
|
//import "location.proto"
|
||||||
|
|
||||||
|
// Sub-message used by Current & Extended to specify preferred units
|
||||||
|
enum Units {
|
||||||
|
UNITS_UNSPECIFIED = 0;
|
||||||
|
UNITS_STANDARD = 1;
|
||||||
|
UNITS_METRIC = 2;
|
||||||
|
UNITS_IMPERIAL = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the current forecast for a given location
|
||||||
|
* Commented parameters in the message definition are not implemeneted yet
|
||||||
|
* location_type {enum} - name or value
|
||||||
|
* units {enum} - name or value
|
||||||
|
* city {string} - case insensitive, spaces and punctuation allowed
|
||||||
|
* zip_code {string} - non-numeric values permitted
|
||||||
|
* coordinates {Coordinates} - Coordinates message with latitude and longitude
|
||||||
|
*/
|
||||||
|
message RequestCurrent {
|
||||||
|
// LocationType location_type = 1;
|
||||||
|
// Units units = 2;
|
||||||
|
string city = 1;
|
||||||
|
// optional string zip_code = 2;
|
||||||
|
// Coordinates coordinates = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response to RequestCurrent
|
||||||
|
message SendCurrent {
|
||||||
|
string payload = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the extended forecast for a given location up to 16 days in the future
|
||||||
|
* Commented parameters in the message definition are not implemeneted yet
|
||||||
|
* location_type {enum} - name or value
|
||||||
|
* units {enum} - name or value
|
||||||
|
* city {string} - case insensitive, spaces and punctuation allowed
|
||||||
|
* zip_code {string} - non-numeric values permitted
|
||||||
|
* coordinates {Coordinates} - Coordinates message with latitude and longitude
|
||||||
|
* days {uint32} - number of days to fetch, max 16
|
||||||
|
*/
|
||||||
|
message RequestExtended {
|
||||||
|
// LocationType location_type = 1;
|
||||||
|
// Units units = 2;
|
||||||
|
string city = 1;
|
||||||
|
// optional string zip_code = 2;
|
||||||
|
// Coordinates coordinates = 3;
|
||||||
|
uint32 days = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response to RequestExtended
|
||||||
|
message SendExtended {
|
||||||
|
string payload = 1;
|
||||||
|
}
|
Loading…
Reference in a new issue