[#306] Define and compile proto files for private node service

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-13 15:47:54 +03:00 committed by Alex Vanin
parent ca225fa3e8
commit 85ec633938
7 changed files with 70 additions and 1 deletions

View file

@ -66,7 +66,7 @@ protoc:
@for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \ @for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \
echo "⇒ Processing $$f "; \ echo "⇒ Processing $$f "; \
protoc \ protoc \
--proto_path=.:./vendor:./vendor/github.com/nspcc-dev/neofs-api-go:/usr/local/include \ --proto_path=.:./vendor:./vendor/github.com/nspcc-dev/neofs-api-go:/usr/local/include:./pkg/services/private \
--gofast_out=plugins=grpc,paths=source_relative:. $$f; \ --gofast_out=plugins=grpc,paths=source_relative:. $$f; \
done done
rm -rf vendor rm -rf vendor

1
go.mod
View file

@ -5,6 +5,7 @@ go 1.14
require ( require (
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
github.com/alecthomas/participle v0.6.0 github.com/alecthomas/participle v0.6.0
github.com/golang/protobuf v1.4.3
github.com/google/uuid v1.1.1 github.com/google/uuid v1.1.1
github.com/hashicorp/golang-lru v0.5.4 github.com/hashicorp/golang-lru v0.5.4
github.com/klauspost/compress v1.11.3 github.com/klauspost/compress v1.11.3

1
go.sum
View file

@ -120,6 +120,7 @@ github.com/go-redis/redis v6.10.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8w
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0= github.com/go-yaml/yaml v2.1.0+incompatible/go.mod h1:w2MrLa16VYP0jy6N7M5kHaCkaLENm+P+Tv+MfurjSw0=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=

BIN
pkg/services/private/service.pb.go generated Normal file

Binary file not shown.

View file

@ -0,0 +1,41 @@
syntax = "proto3";
package private;
import "types.proto";
option go_package = "github.com/nspcc-dev/neofs-node/pkg/services/private";
// `PrivateService` provides an interface for internal work with the storage node.
service PrivateService {
// Performs health check of the storage node.
rpc HealthCheck (HealthCheckRequest) returns (HealthCheckResponse);
}
// Health check request.
message HealthCheckRequest {
// Health check request body.
message Body {
}
// Body of health check request message.
Body body = 1;
// Body signature.
Signature signature = 2;
}
// Health check request.
message HealthCheckResponse {
// Health check response body
message Body {
// Health status of storage node.
HealthStatus status = 1;
}
// Body of health check response message.
Body body = 1;
// Body signature.
Signature signature = 2;
}

BIN
pkg/services/private/types.pb.go generated Normal file

Binary file not shown.

View file

@ -0,0 +1,26 @@
syntax = "proto3";
package private;
option go_package = "github.com/nspcc-dev/neofs-node/pkg/services/private";
// Signature of some message.
message Signature {
// Public key used for signing.
bytes key = 1 [json_name = "key"];
// Binary signature.
bytes sign = 2 [json_name = "signature"];
}
// Health status of the storage node.
enum HealthStatus {
// Undefined status, default value.
STATUS_UNDEFINED = 0;
// Node is online.
ONLINE = 1;
// Node is offline.
OFFLINE = 2;
}