Update object package docs

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-10-15 21:28:19 +03:00 committed by Stanislav Bogatyrev
parent 3f6c211fef
commit 27f4b1ad63
2 changed files with 177 additions and 161 deletions

View file

@ -8,7 +8,7 @@ option csharp_namespace = "NeoFS.API.v2.Object";
import "refs/types.proto";
import "session/types.proto";
// Type of the object payload content
// Type of the object payload content.
enum ObjectType {
// Just a normal object
REGULAR = 0;
@ -16,7 +16,7 @@ enum ObjectType {
// Used internally to identify deleted objects
TOMBSTONE = 1;
// Identifies that the object holds StorageGroup information
// StorageGroup information
STORAGE_GROUP = 2;
}
@ -30,7 +30,8 @@ enum MatchType {
// Short header fields
message ShortHeader {
// Object format version.
// Object format version. Effectively the version of API library used to
// create particular object
neo.fs.v2.refs.Version version = 1;
// Epoch when the object was created
@ -43,14 +44,14 @@ message ShortHeader {
ObjectType object_type = 4;
// Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
// `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown
uint64 payload_length = 5;
}
// Object Headers
// Object Header
message Header {
// Object format version.
// Effectively the version of API library used to create particular object
// Object format version. Effectively the version of API library used to
// create particular object
neo.fs.v2.refs.Version version = 1;
// Object's container
@ -63,20 +64,20 @@ message Header {
uint64 creation_epoch = 4;
// Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
// `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown
uint64 payload_length = 5;
// Hash of payload bytes
neo.fs.v2.refs.Checksum payload_hash = 6;
// Special object type
// Type of the object payload content
ObjectType object_type = 7;
// Homomorphic hash of the object payload.
neo.fs.v2.refs.Checksum homomorphic_hash = 8;
// Session token, if it was used during Object creation.
// Need it to verify integrity and authenticity out of Request scope.
// Session token, if it was used during Object creation. Need it to verify
// integrity and authenticity out of Request scope.
neo.fs.v2.session.SessionToken session_token = 9;
// `Attribute` is a user-defined Key-Value metadata pair attached to the
@ -99,14 +100,15 @@ message Header {
// User-defined object attributes
repeated Attribute attributes = 10;
// Information about spawning the objects through a payload splitting.
// Bigger objects can be split into a chain of smaller objects. Information
// about inter-dependencies between spawned objects and how to re-construct
// the original one is in the `Split` headers. Parent and children objects
// must be within the same container.
message Split {
// Identifier of the origin object.
// Parent and children objects must be within the same container.
// Parent object_id is known only to the minor child.
// Identifier of the origin object. Known only to the minor child.
neo.fs.v2.refs.ObjectID parent = 1;
// Previous carries identifier of the left split neighbor.
// Identifier of the left split neighbor
neo.fs.v2.refs.ObjectID previous = 2;
// `signature` field of the parent object. Used to reconstruct parent.
@ -115,19 +117,18 @@ message Header {
// `header` field of the parent object. Used to reconstruct parent.
Header parent_header = 4;
// Children carries list of identifiers of the objects generated by splitting the current.
// List of identifiers of the objects generated by splitting current one.
repeated neo.fs.v2.refs.ObjectID children = 5;
}
// Position of the object in the split hierarchy.
// Position of the object in the split hierarchy
Split split = 11;
}
// Object structure.
// 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.
message Object {
// Object's unique identifier.
// Object is content-addressed. It means id will change if header or payload
// changes. It's calculated as a hash of header field, which contains hash of
// object's payload
neo.fs.v2.refs.ObjectID object_id = 1;
// Signed object_id