frostfs-api-go/object/types.proto

106 lines
4.5 KiB
Protocol Buffer
Raw Normal View History

2019-11-18 13:34:06 +00:00
syntax = "proto3";
package object;
option go_package = "github.com/nspcc-dev/neofs-proto/object";
import "refs/types.proto";
import "session/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
message Range {
2019-11-20 15:50:10 +00:00
uint64 Offset = 1; // Offset of the data range
uint64 Length = 2; // Length of the data range
2019-11-18 13:34:06 +00:00
}
message UserHeader {
2019-11-20 15:50:10 +00:00
string Key = 1; // Key of the user's header
string Value = 2; // Value of the user's header
2019-11-18 13:34:06 +00:00
}
message Header {
oneof Value {
2019-11-20 15:50:10 +00:00
Link Link = 1; // Link to other objects
refs.Address Redirect = 2; // RedirectNot used yet
UserHeader UserHeader = 3; // UserHeader defined by user
Transform Transform = 4; // Transform defines transform operation (e.g. payload split)
Tombstone Tombstone = 5; // Tombstone header that set up in deleted objects
session.VerificationHeader Verify = 6; // Verify header that contains session public key and user's signature
bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"]; // Homomorphic hash of original object payload
bytes PayloadChecksum = 8; // PayloadChecksum of actual object's payload
IntegrityHeader Integrity = 9; // Integrity header with checksum of all above headers in the object
StorageGroup StorageGroup = 10; // StorageGroup contains meta information for the data audit
2019-11-18 13:34:06 +00:00
}
}
message Tombstone {
2019-11-20 15:50:10 +00:00
uint64 Epoch = 1; // Epoch when tombstone was created
2019-11-18 13:34:06 +00:00
}
message SystemHeader {
2019-11-20 15:50:10 +00:00
uint64 Version = 1; // Version of the object structure
uint64 PayloadLength = 2; // Object payload length
2019-11-18 13:34:06 +00:00
2019-11-20 15:50:10 +00:00
bytes ID = 3 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false]; // ObjectID is a UUID
bytes OwnerID = 4 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; // OwnerID is a wallet address
bytes CID = 5 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false]; // ContainerID is a SHA256 hash of the container structure
CreationPoint CreatedAt = 6 [(gogoproto.nullable) = false]; // Timestamp of object creation
2019-11-18 13:34:06 +00:00
}
message CreationPoint {
2019-11-20 15:50:10 +00:00
int64 UnixTime = 1; // Date of creation in unixtime format
uint64 Epoch = 2; // Date of creation in NeoFS epochs
2019-11-18 13:34:06 +00:00
}
message IntegrityHeader {
2019-11-20 15:50:10 +00:00
bytes HeadersChecksum = 1; // Checksum of all above headers in the object
bytes ChecksumSignature = 2; // User's signature of checksum to verify if it is correct
2019-11-18 13:34:06 +00:00
}
message Link {
enum Type {
Unknown = 0;
2019-11-20 15:50:10 +00:00
Parent = 1; // Parent object created during object transformation
Previous = 2; // Previous object in the linked list created during object transformation
Next = 3; // Next object in the linked list created during object transformation
Child = 4; // Child object created during object transformation
StorageGroup = 5; // Object that included into this storage group
2019-11-18 13:34:06 +00:00
}
2019-11-20 15:50:10 +00:00
Type type = 1; // Link type
bytes ID = 2 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false]; // Object id
2019-11-18 13:34:06 +00:00
}
message Transform {
enum Type {
Unknown = 0;
2019-11-20 15:50:10 +00:00
Split = 1; // Object created after payload split
Sign = 2; // Object created after re-signing (doesn't used)
Mould = 3; // Object created after filling missing headers in the object
2019-11-18 13:34:06 +00:00
}
2019-11-20 15:50:10 +00:00
Type type = 1; // Type of object transformation
2019-11-18 13:34:06 +00:00
}
message Object {
2019-11-20 15:50:10 +00:00
SystemHeader SystemHeader = 1 [(gogoproto.nullable) = false]; // System header
repeated Header Headers = 2 [(gogoproto.nullable) = false]; // Extended headers
bytes Payload = 3; // Object's payload
2019-11-18 13:34:06 +00:00
}
message StorageGroup {
2019-11-20 15:50:10 +00:00
uint64 ValidationDataSize = 1; // Size of the all object's payloads included into storage group
bytes ValidationHash = 2 [(gogoproto.customtype) = "Hash", (gogoproto.nullable) = false]; // Homomorphic hash of all object's payloads included into storage group
2019-11-18 13:34:06 +00:00
message Lifetime {
enum Unit {
2019-11-20 15:50:10 +00:00
Unlimited = 0; // Storage group always valid
NeoFSEpoch = 1; // Storage group is valid until lifetime NeoFS epoch
UnixTime = 2; // Storage group is valid until lifetime unix timestamp
2019-11-18 13:34:06 +00:00
}
2019-11-20 15:50:10 +00:00
Unit unit = 1 [(gogoproto.customname) = "Unit"]; // Lifetime type
int64 Value = 2; // Lifetime value
2019-11-18 13:34:06 +00:00
}
2019-11-20 15:50:10 +00:00
Lifetime lifetime = 3 [(gogoproto.customname) = "Lifetime"]; // Time until storage group is valid
2019-11-18 13:34:06 +00:00
}