storj/protos/netstate/netstate.proto
Natalie Villasana 1a06c2b0c7 adding grpc interface to network state (#33)
* adds proto files for netstate crud

* moves netstate grpc client lib into pkg/netstate where grpc netstate service is defined

* starts adding grpc client and server tests

* moves creation of grpc server into cmd/netstate/main.go, removes pkg/netstate/service.go, adds more client testing

* changed all 'Path' and 'Value' fields from strings to bytes, updated tests

* changes Get and Delete in proto file to receive 'requests' instead of 'file paths', adds tests for Get, List, and Delete

* changes netstate-routes to get 'fileValue' bytes not 'fileInfo'

* adds example rpc client in 'examples' and adds more specific debug logs

* adds readmes for netstate rpc services and updates netstate-routes
2018-05-14 18:31:26 -06:00

60 lines
1.6 KiB
Protocol Buffer

// Copyright (C) 2018 Storj Labs, Inc.
// See LICENSE for copying information.
syntax = "proto3";
package netstate;
// NetState defines the interface for interacting with the network state persistence layer
service NetState {
// Put formats and hands off a file path to be saved to boltdb
rpc Put(FilePath) returns (PutResponse);
// Get formats and hands off a file path to get a small value from boltdb
rpc Get(GetRequest) returns (GetResponse);
// List calls the bolt client's List function and returns all file paths
rpc List(ListRequest) returns (ListResponse);
// Delete formats and hands off a file path to delete from boltdb
rpc Delete(DeleteRequest) returns (DeleteResponse);
}
// FilePath is a request message for the Put rpc call
message FilePath {
bytes path = 1;
// smallValue is a value too small to be broken up and stored
// in different places
bytes smallValue = 2;
}
// GetRequest is a request message for the Get rpc call
message GetRequest {
bytes path = 1;
}
// ListRequest is a request message for the List rpc call
message ListRequest {
bytes bucket = 1;
}
// PutResponse is a response message for the Put rpc call
message PutResponse {
string confirmation = 1;
}
// GetResponse is a response message for the Get rpc call
message GetResponse {
bytes smallValue = 1;
}
// ListResponse is a response message for the List rpc call
message ListResponse {
repeated bytes filepaths = 1;
}
message DeleteRequest {
bytes path = 1;
}
// DeleteResponse is a response message for the Delete rpc call
message DeleteResponse {
string confirmation = 1;
}