[#306] Define and compile proto files for private node service
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
ca225fa3e8
commit
85ec633938
7 changed files with 69 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -66,7 +66,7 @@ protoc:
|
|||
@for f in `find . -type f -name '*.proto' -not -path './vendor/*'`; do \
|
||||
echo "⇒ Processing $$f "; \
|
||||
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; \
|
||||
done
|
||||
rm -rf vendor
|
||||
|
|
1
go.mod
1
go.mod
|
@ -5,6 +5,7 @@ go 1.14
|
|||
require (
|
||||
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
|
||||
github.com/alecthomas/participle v0.6.0
|
||||
github.com/golang/protobuf v1.4.3
|
||||
github.com/google/uuid v1.1.1
|
||||
github.com/hashicorp/golang-lru v0.5.4
|
||||
github.com/klauspost/compress v1.11.3
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
BIN
pkg/services/private/service.pb.go
generated
Normal file
BIN
pkg/services/private/service.pb.go
generated
Normal file
Binary file not shown.
41
pkg/services/private/service.proto
Normal file
41
pkg/services/private/service.proto
Normal 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
BIN
pkg/services/private/types.pb.go
generated
Normal file
Binary file not shown.
26
pkg/services/private/types.proto
Normal file
26
pkg/services/private/types.proto
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue