From d6bf64589f027249dff6fd470ede5e27ab73b510 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 16 Feb 2022 10:13:43 +0300 Subject: [PATCH] [#194] object: Define payload format of LOCK objects Define `object.Lock` message which carries list of locked objects. Require this message to be a payload of locked objects (`LOCK` type). Signed-off-by: Leonard Lyubich --- lock/types.proto | 14 ++++++++++++++ object/types.proto | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 lock/types.proto diff --git a/lock/types.proto b/lock/types.proto new file mode 100644 index 0000000..30a9607 --- /dev/null +++ b/lock/types.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package neo.fs.v2.lock; + +option go_package = "github.com/nspcc-dev/neofs-api-go/v2/lock/grpc;lock"; +option csharp_namespace = "Neo.FileStorage.API.Lock"; + +import "refs/types.proto"; + +// Lock keeps record of objects that are locked. +message Lock { + // List of objects to be locked. + repeated neo.fs.v2.refs.ObjectID members = 1 [json_name = "members"]; +} diff --git a/object/types.proto b/object/types.proto index 95cb8f1..dc0bb69 100644 --- a/object/types.proto +++ b/object/types.proto @@ -184,6 +184,14 @@ message Header { // Object structure. Object is immutable and content-addressed. It means // `ObjectID` will change if header or payload changes. It's calculated as a // hash of header field, which contains hash of object's payload. +// +// Payload format depends on object type specified in the header: +// * **LOCK** \ +// Must be encoded message of type `Lock` in Protocol Buffers binary format +// with direct field order. Member list must no be empty or carry empty IDs. +// All members must regular objects (`REGULAR` type). Lifetime of the lock +// object is limited similar to regular objects in `__NEOFS__EXPIRATION_EPOCH` +// attribute. message Object { // Object's unique identifier. neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"];