frostfs-api-go/object/types.proto

135 lines
4.6 KiB
Protocol Buffer
Raw Normal View History

2019-11-18 13:34:06 +00:00
syntax = "proto3";
package object;
2020-03-31 07:05:26 +00:00
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
2020-02-05 13:58:06 +00:00
option csharp_namespace = "NeoFS.API.Object";
2019-11-18 13:34:06 +00:00
import "refs/types.proto";
2020-04-28 09:50:52 +00:00
import "service/verify.proto";
2019-12-02 14:56:06 +00:00
import "storagegroup/types.proto";
2019-11-18 13:34:06 +00:00
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
message Range {
// Offset of the data range
uint64 Offset = 1;
// Length of the data range
uint64 Length = 2;
2019-11-18 13:34:06 +00:00
}
message UserHeader {
// Key of the user's header
string Key = 1;
// Value of the user's header
string Value = 2;
2019-11-18 13:34:06 +00:00
}
message Header {
oneof Value {
// Link to other objects
2019-12-02 14:56:06 +00:00
Link Link = 1;
// Redirect not used yet
2019-12-02 14:56:06 +00:00
refs.Address Redirect = 2;
// UserHeader is a set of KV headers defined by user
2019-12-02 14:56:06 +00:00
UserHeader UserHeader = 3;
// Transform defines transform operation (e.g. payload split)
2019-12-02 14:56:06 +00:00
Transform Transform = 4;
// Tombstone header that set up in deleted objects
2019-12-02 14:56:06 +00:00
Tombstone Tombstone = 5;
2020-04-28 09:50:52 +00:00
// Token header contains token of the session within which the object was created
service.Token Token = 6;
// HomoHash is a homomorphic hash of original object payload
2019-12-02 14:56:06 +00:00
bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"];
// PayloadChecksum of actual object's payload
2019-12-02 14:56:06 +00:00
bytes PayloadChecksum = 8;
// Integrity header with checksum of all above headers in the object
2019-12-02 14:56:06 +00:00
IntegrityHeader Integrity = 9;
// StorageGroup contains meta information for the data audit
2019-12-02 14:56:06 +00:00
storagegroup.StorageGroup StorageGroup = 10;
// PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert.
PublicKey PublicKey = 11;
2019-11-18 13:34:06 +00:00
}
}
message Tombstone {}
2019-11-18 13:34:06 +00:00
message SystemHeader {
// Version of the object structure
uint64 Version = 1;
// PayloadLength is an object payload length
uint64 PayloadLength = 2;
// ID is an object identifier, is a valid UUIDv4
bytes ID = 3 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false];
// OwnerID is a wallet address
bytes OwnerID = 4 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// CID is a SHA256 hash of the container structure (container identifier)
bytes CID = 5 [(gogoproto.customtype) = "CID", (gogoproto.nullable) = false];
// CreatedAt is a timestamp of object creation
CreationPoint CreatedAt = 6 [(gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message CreationPoint {
2020-04-28 13:30:47 +00:00
option (gogoproto.goproto_stringer) = false;
// UnixTime is a date of creation in unixtime format
int64 UnixTime = 1;
// Epoch is a date of creation in NeoFS epochs
uint64 Epoch = 2;
2019-11-18 13:34:06 +00:00
}
message IntegrityHeader {
// HeadersChecksum is a checksum of all above headers in the object
bytes HeadersChecksum = 1;
// ChecksumSignature is an user's signature of checksum to verify if it is correct
bytes ChecksumSignature = 2;
2019-11-18 13:34:06 +00:00
}
message Link {
enum Type {
Unknown = 0;
// Parent object created during object transformation
Parent = 1;
// Previous object in the linked list created during object transformation
Previous = 2;
// Next object in the linked list created during object transformation
Next = 3;
// Child object created during object transformation
Child = 4;
// Object that included into this storage group
StorageGroup = 5;
2019-11-18 13:34:06 +00:00
}
// Type of link
Type type = 1;
// ID is an object identifier, is a valid UUIDv4
bytes ID = 2 [(gogoproto.customtype) = "ID", (gogoproto.nullable) = false];
2019-11-18 13:34:06 +00:00
}
message Transform {
enum Type {
Unknown = 0;
// Split sets when object created after payload split
Split = 1;
// Sign sets when object created after re-signing (doesn't used)
Sign = 2;
// Mould sets when object created after filling missing headers in the object
Mould = 3;
2019-11-18 13:34:06 +00:00
}
// Type of object transformation
Type type = 1;
2019-11-18 13:34:06 +00:00
}
message Object {
// SystemHeader describes system header
SystemHeader SystemHeader = 1 [(gogoproto.nullable) = false];
// Headers describes a set of an extended headers
repeated Header Headers = 2 [(gogoproto.nullable) = false];
// Payload is an object's payload
bytes Payload = 3;
2019-11-18 13:34:06 +00:00
}
message PublicKey {
// Value contains marshaled ecdsa public key
bytes Value = 1;
}