Add gRPC spec

This commit is contained in:
Peter 2020-05-03 10:11:19 +02:00 committed by baez90
parent 3466037421
commit 61841648b1
3 changed files with 48 additions and 3 deletions

View file

@ -55,9 +55,7 @@ debug:
generate:
@go generate ./...
protoc:
@protoc --proto_path $(DIR)api/ --go_out=plugins=grpc:internal/grpc --go_opt=paths=source_relative $(shell find $(DIR)api/ -type f -name "*.proto")
@protoc --proto_path $(DIR)api/ --go_out=plugins=grpc:internal/rpc --go_opt=paths=source_relative $(shell find $(DIR)api/ -type f -name "*.proto")
snapshot-release:
@goreleaser release --snapshot --skip-publish --rm-dist

28
api/endpoints.proto Normal file
View file

@ -0,0 +1,28 @@
syntax = "proto3";
option go_package = "github.com/baez90/inetmock/internal/rpc";
option java_multiple_files = true;
option java_package = "com.github.baez90.inetmock.rpc";
option java_outer_classname = "EndpointsProto";
package inetmock;
service Endpoints {
rpc GetEndpoints (GetEndpointsRequest) returns (GetEndpointsResponse) {
}
}
message GetEndpointsRequest {
}
message GetEndpointsResponse {
repeated Endpoint endpoints = 1;
}
message Endpoint {
string id = 1;
string name = 2;
string handler = 3;
string listenAddress = 4;
int32 port = 5;
}

19
api/handlers.proto Normal file
View file

@ -0,0 +1,19 @@
syntax = "proto3";
option go_package = "github.com/baez90/inetmock/internal/rpc";
option java_multiple_files = true;
option java_package = "com.github.baez90.inetmock.rpc";
option java_outer_classname = "HandlersProto";
package inetmock;
service Handlers {
rpc GetHandlers(GetHandlersRequest) returns (GetHandlersResponse) {}
}
message GetHandlersRequest {
}
message GetHandlersResponse {
repeated string handlers = 1;
}