mirror of
https://codeberg.org/andyscott/OpenWeather-gRPC-API.git
synced 2024-12-21 12:13:09 -05:00
Created module and basic proto files
This commit is contained in:
parent
44ee406dfb
commit
b73ca7da06
4 changed files with 55 additions and 0 deletions
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module codeberg.org/OpenWeatherMap-gRPC-API
|
||||
|
||||
go 1.18
|
19
proto/current.proto
Normal file
19
proto/current.proto
Normal file
|
@ -0,0 +1,19 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package weather;
|
||||
|
||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
||||
|
||||
message RequestCurrent {
|
||||
oneof location {
|
||||
string city = 1;
|
||||
string zip_code = 2;
|
||||
string coords = 3; // Comma separated coordinates, e.g. "44.5,-123.3"
|
||||
}
|
||||
optional string state = 4; // US Only
|
||||
optional string country = 5; // Must be ISO 3166 country code
|
||||
}
|
||||
|
||||
message SendCurrent {
|
||||
string payload = 1;
|
||||
}
|
20
proto/extended.proto
Normal file
20
proto/extended.proto
Normal file
|
@ -0,0 +1,20 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package weather;
|
||||
|
||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
||||
|
||||
message RequestExtended {
|
||||
oneof location {
|
||||
string city = 1;
|
||||
string zip_code = 2;
|
||||
string coords = 3; // Comma separated coordinates, e.g. "44.5,-123.3"
|
||||
}
|
||||
optional string state = 4; // US Only
|
||||
optional string country = 5; // Must be ISO 3166 country code
|
||||
uint32 days = 6;
|
||||
}
|
||||
|
||||
message SendExtended {
|
||||
string payload = 1;
|
||||
}
|
13
proto/weather.proto
Normal file
13
proto/weather.proto
Normal file
|
@ -0,0 +1,13 @@
|
|||
syntax = "proto3";
|
||||
|
||||
package weather;
|
||||
|
||||
option go_package = "codeberg.org/andcscott/OpenWeatherMap-gRPC-API/proto";
|
||||
|
||||
import "current.proto";
|
||||
import "extended.proto";
|
||||
|
||||
service WeatherService {
|
||||
rpc Current(RequestCurrent) returns (SendCurrent);
|
||||
rpc Extended(RequestExtended) returns (SendExtended);
|
||||
}
|
Loading…
Reference in a new issue