storj/protos/piecestore/piece_store.proto
Alexander Leitner b0db33f919
Bandwidth accounting (#134)
* captplanet standalone farmer setup

* Bandwidth Allocation

* utils.Close method changed to utils.LogClose

* Get build temporarily working

* Get/Put for PSClient should take payer bandwidth allocations rather than the NewPSClient function

* Update example client to reflect changes in client API

* Update ecclient to use latest PSClient, Make NewPSClient return error also

* Updated pieceranger tests to check for errors; sign method should take byte array

* Handle defers in store.go better

* Fix defer functions in psdb.go

* fun times

* Protobuf bandwidthallocation data is now a byte array

* Remove psservice package and merge it into pstore server

* Write wrapper for database calls

* Change all expiration names in protobuf to be more informative; add defer in retrieve; remove old comment

* Make PSDB tests implementation independent rather than method independent

* get rid of payer, renter in ecclient

* add context monitoring in store and retrieve
2018-08-17 13:40:15 -04:00

90 lines
1.6 KiB
Protocol Buffer

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
syntax = "proto3";
package piecestoreroutes;
service PieceStoreRoutes {
rpc Piece(PieceId) returns (PieceSummary) {}
rpc Retrieve(stream PieceRetrieval) returns (stream PieceRetrievalStream) {}
rpc Store(stream PieceStore) returns (PieceStoreSummary) {}
rpc Delete(PieceDelete) returns (PieceDeleteSummary) {}
}
message PayerBandwidthAllocation {
message Data {
bytes payer = 1;
bytes renter = 2;
int64 max_size = 3;
int64 expiration_unix_sec = 4;
string serial_number = 5;
}
bytes signature = 1;
bytes data = 2; // Serialization of above Data Struct
}
message RenterBandwidthAllocation {
message Data {
PayerBandwidthAllocation payer_allocation = 1;
int64 total = 2;
}
bytes signature = 1;
bytes data = 2; // Serialization of above Data Struct
}
message PieceStore {
message PieceData {
string id = 1;
int64 expiration_unix_sec = 2;
bytes content = 3;
}
RenterBandwidthAllocation bandwidthallocation = 1;
PieceData piecedata = 2;
}
message PieceId {
string id = 1;
}
message PieceSummary {
string id = 1;
int64 size = 2;
int64 expiration_unix_sec = 3;
}
message PieceRetrieval {
message PieceData {
string id = 1;
int64 size = 2;
int64 offset = 3;
}
RenterBandwidthAllocation bandwidthallocation = 1;
PieceData pieceData = 2;
}
message PieceRetrievalStream {
int64 size = 1;
bytes content = 2;
}
message PieceDelete {
string id = 1;
}
message PieceDeleteSummary {
string message = 1;
}
message PieceStoreSummary {
string message = 1;
int64 totalReceived = 2;
}