Skip to content

Commit

Permalink
added grpc and implemented method
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Lazarev authored and alexlzrv committed Apr 15, 2024
1 parent 3345ee3 commit 8c05b0c
Show file tree
Hide file tree
Showing 12 changed files with 611 additions and 37 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ _golangci-lint-rm-unformatted-report: _golangci-lint-format-report

.PHONY: golangci-lint-clean
golangci-lint-clean:
sudo rm -rf ./golangci-lint
sudo rm -rf ./golangci-lint

.PHONY: proto
proto:
protoc -I ./api --go_out ./api/server --go_opt paths=source_relative --go-grpc_out ./api/server --go-grpc_opt paths=source_relative ./api/server.proto
24 changes: 24 additions & 0 deletions api/server.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
syntax = "proto3";

package server;

option go_package = "./server";

message Metric {
string ID = 1;
string MType = 2;
float Value = 3;
int64 Delta = 4;
}

message UpdateMetricRequest {
Metric metric = 1;
}

message UpdateMetricResponse {
string error = 1;
}

service Metrics {
rpc UpdateMetrics (stream UpdateMetricRequest) returns (UpdateMetricResponse) {}
}
304 changes: 304 additions & 0 deletions api/server/server.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8c05b0c

Please sign in to comment.