Created module and basic proto files

This commit is contained in:
Andrew Scott 2022-07-25 16:16:27 -04:00
parent 44ee406dfb
commit b73ca7da06
Signed by: a
GPG key ID: 3EB62D0BBB8DB381
4 changed files with 55 additions and 0 deletions

3
go.mod Normal file
View file

@ -0,0 +1,3 @@
module codeberg.org/OpenWeatherMap-gRPC-API
go 1.18

19
proto/current.proto Normal file
View 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
View 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
View 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);
}