storj/pkg/pb/pointerdb.proto
2019-03-30 13:21:49 +02:00

72 lines
1.7 KiB
Protocol Buffer

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
syntax = "proto3";
option go_package = "pb";
package pointerdb;
import "google/protobuf/timestamp.proto";
import "gogo.proto";
import "node.proto";
import "piecestore.proto";
import "orders.proto";
message RedundancyScheme {
enum SchemeType {
RS = 0;
}
SchemeType type = 1;
// these values apply to RS encoding
int32 min_req = 2; // minimum required for reconstruction
int32 total = 3; // total amount of pieces we generated
int32 repair_threshold = 4; // amount of pieces we need to drop to before triggering repair
int32 success_threshold = 5; // amount of pieces we need to store to call it a success
int32 erasure_share_size = 6;
}
message RemotePiece {
int32 piece_num = 1;
bytes node_id = 2 [(gogoproto.customtype) = "NodeID", (gogoproto.nullable) = false];
orders.PieceHash hash = 3;
}
message RemoteSegment {
RedundancyScheme redundancy = 1;
bytes root_piece_id = 2 [(gogoproto.customtype) = "PieceID", (gogoproto.nullable) = false];
repeated RemotePiece remote_pieces = 3;
bytes merkle_root = 4; // root hash of the hashes of all of these pieces
}
message Pointer {
enum DataType {
INLINE = 0;
REMOTE = 1;
}
DataType type = 1;
bytes inline_segment = 3;
RemoteSegment remote = 4;
int64 segment_size = 5;
google.protobuf.Timestamp creation_date = 6;
google.protobuf.Timestamp expiration_date = 7;
bytes metadata = 8;
}
// ListResponse is a response message for the List rpc call
message ListResponse {
message Item {
string path = 1;
Pointer pointer = 2;
bool is_prefix = 3;
}
repeated Item items = 1;
bool more = 2;
}