Mutex/auth grpc (#50)

* initial commit for PUT request authorization

* inital auth for put request

* auth. request working for all req

* deleted library

* removed .db files

* work in progress for modifying test suite to accomodate credentials

* modified tests

* gofmt, fixed code based on suggestions; test passed

* gofmt again

* merged nat's update on pointers, passed tests, cleanup from git rebase

* fixed fmt

* fixed fmt on tests

* work in progress

* reduced code

* fixed naming conventions

* added line in code

* fixed server bug, merged new code to server, added env

* fixed linter; getting cright issues on piecestore

* added comments for what passes on the creds
This commit is contained in:
nfarah86 2018-06-04 09:45:07 -07:00 committed by GitHub
parent 040edbb7f3
commit f9af3b6ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 573 additions and 189 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@
*.dll
*.so
*.dylib
*.db
# Test binary, build with `go test -c`
*.test

View File

@ -9,6 +9,7 @@ import (
"fmt"
"net"
"github.com/spf13/viper"
"go.uber.org/zap"
"google.golang.org/grpc"
monkit "gopkg.in/spacemonkeygo/monkit.v2"
@ -26,18 +27,20 @@ var (
func (s *serv) Process(ctx context.Context) error {
bdb, err := boltdb.New(s.logger, *dbPath)
if err != nil {
return err
}
defer bdb.Close()
// start grpc server
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port))
if err != nil {
return err
}
grpcServer := grpc.NewServer()
proto.RegisterNetStateServer(grpcServer, netstate.NewServer(bdb, s.logger))
s.logger.Debug(fmt.Sprintf("server listening on port %d", *port))
@ -55,6 +58,12 @@ func (s *serv) SetLogger(l *zap.Logger) error {
return nil
}
func setEnv() error {
viper.SetEnvPrefix("API")
viper.AutomaticEnv()
return nil
}
func (s *serv) SetMetricHandler(m *monkit.Registry) error {
s.metrics = m
return nil
@ -63,5 +72,6 @@ func (s *serv) SetMetricHandler(m *monkit.Registry) error {
func (s *serv) InstanceID() string { return "" }
func main() {
setEnv()
process.Must(process.Main(&serv{}))
}

View File

@ -44,6 +44,7 @@ func main() {
ctx := context.Background()
// Example pointer paths to put
//pr1 passes with api creds
pr1 := proto.PutRequest{
Path: []byte("welcome/to/my/pointer/journey"),
Pointer: &proto.Pointer{
@ -54,7 +55,9 @@ func main() {
},
InlineSegment: []byte("granola"),
},
APIKey: []byte("abc123"),
}
// pr2 passes with api creds
pr2 := proto.PutRequest{
Path: []byte("so/many/pointers"),
Pointer: &proto.Pointer{
@ -65,7 +68,9 @@ func main() {
},
InlineSegment: []byte("m&ms"),
},
APIKey: []byte("abc123"),
}
// pr3 fails api creds
pr3 := proto.PutRequest{
Path: []byte("another/pointer/for/the/pile"),
Pointer: &proto.Pointer{
@ -76,9 +81,11 @@ func main() {
},
InlineSegment: []byte("popcorn"),
},
APIKey: []byte("abc13"),
}
// Example Puts
// puts passes api creds
_, err = client.Put(ctx, &pr1)
if err != nil || status.Code(err) == codes.Internal {
logger.Error("failed to put", zap.Error(err))
@ -93,36 +100,45 @@ func main() {
}
// Example Get
// get passes api creds
getReq := proto.GetRequest{
Path: []byte("so/many/pointers"),
Path: []byte("so/many/pointers"),
APIKey: []byte("abc123"),
}
getRes, err := client.Get(ctx, &getReq)
if err != nil || status.Code(err) == codes.Internal {
logger.Error("failed to get", zap.Error(err))
} else {
pointer := string(getRes.Pointer)
logger.Debug("get response: " + pointer)
}
pointer := string(getRes.Pointer)
logger.Debug("get response: " + pointer)
// Example List
// list passes api creds
listReq := proto.ListRequest{
// This pagination functionality doesn't work yet.
// The given arguments are placeholders.
StartingPathKey: []byte("test/pointer/path"),
Limit: 5,
APIKey: []byte("abc123"),
}
listRes, err := client.List(ctx, &listReq)
if err != nil || status.Code(err) == codes.Internal {
logger.Error("failed to list file paths")
} else {
var stringList []string
for _, pathByte := range listRes.Paths {
stringList = append(stringList, string(pathByte))
}
logger.Debug("listed paths: " + strings.Join(stringList, ", "))
}
var stringList []string
for _, pathByte := range listRes.Paths {
stringList = append(stringList, string(pathByte))
}
logger.Debug("listed paths: " + strings.Join(stringList, ", "))
// Example Delete
// delete passes api creds
delReq := proto.DeleteRequest{
Path: []byte("welcome/to/my/pointer/journey"),
Path: []byte("welcome/to/my/pointer/journey"),
APIKey: []byte("abc123"),
}
_, err = client.Delete(ctx, &delReq)
if err != nil || status.Code(err) == codes.Internal {

View File

@ -54,6 +54,7 @@ func TestNetStateClient(t *testing.T) {
},
InlineSegment: []byte("oatmeal"),
},
APIKey: []byte("abc123"),
}
if mdb.timesCalled != 0 {
@ -85,7 +86,8 @@ func TestNetStateClient(t *testing.T) {
// Tests Server.Get
getReq := pb.GetRequest{
Path: []byte("here/is/a/path"),
Path: []byte("here/is/a/path"),
APIKey: []byte("abc123"),
}
getRes, err := c.Get(ctx, &getReq)
@ -110,6 +112,7 @@ func TestNetStateClient(t *testing.T) {
},
InlineSegment: []byte("raisins"),
},
APIKey: []byte("abc123"),
}
_, err = c.Put(ctx, &pr2)
@ -123,7 +126,8 @@ func TestNetStateClient(t *testing.T) {
// Test Server.Delete
delReq := pb.DeleteRequest{
Path: []byte("here/is/a/path"),
Path: []byte("here/is/a/path"),
APIKey: []byte("abc123"),
}
_, err = c.Delete(ctx, &delReq)
@ -141,6 +145,7 @@ func TestNetStateClient(t *testing.T) {
// The given arguments are placeholders.
StartingPathKey: []byte("test/pointer/path"),
Limit: 5,
APIKey: []byte("abc123"),
}
listRes, err := c.List(ctx, &listReq)

View File

@ -8,9 +8,11 @@ import (
"github.com/golang/protobuf/proto"
"go.uber.org/zap"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"storj.io/storj/netstate/auth"
pb "storj.io/storj/protos/netstate"
"storj.io/storj/storage/boltdb"
)
@ -39,10 +41,23 @@ type DB interface {
Delete([]byte) error
}
func (s *Server) validateAuth(APIKeyBytes []byte) error {
if !auth.ValidateAPIKey(string(APIKeyBytes)) {
s.logger.Error("unauthorized request: ", zap.Error(grpc.Errorf(codes.Unauthenticated, "Invalid API credential")))
return grpc.Errorf(codes.Unauthenticated, "Invalid API credential")
}
return nil
}
// Put formats and hands off a file path to be saved to boltdb
func (s *Server) Put(ctx context.Context, putReq *pb.PutRequest) (*pb.PutResponse, error) {
s.logger.Debug("entering netstate put")
APIKeyBytes := []byte(putReq.APIKey)
if err := s.validateAuth(APIKeyBytes); err != nil {
return nil, err
}
pointerBytes, err := proto.Marshal(putReq.Pointer)
if err != nil {
s.logger.Error("err marshaling pointer", zap.Error(err))
@ -67,7 +82,13 @@ func (s *Server) Put(ctx context.Context, putReq *pb.PutRequest) (*pb.PutRespons
func (s *Server) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error) {
s.logger.Debug("entering netstate get")
APIKeyBytes := []byte(req.APIKey)
if err := s.validateAuth(APIKeyBytes); err != nil {
return nil, err
}
pointerBytes, err := s.DB.Get(req.Path)
if err != nil {
s.logger.Error("err getting file", zap.Error(err))
return nil, status.Errorf(codes.Internal, err.Error())
@ -82,7 +103,13 @@ func (s *Server) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse,
func (s *Server) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error) {
s.logger.Debug("entering netstate list")
APIKeyBytes := []byte(req.APIKey)
if err := s.validateAuth(APIKeyBytes); err != nil {
return nil, err
}
pathKeys, err := s.DB.List()
if err != nil {
s.logger.Error("err listing path keys", zap.Error(err))
return nil, status.Errorf(codes.Internal, err.Error())
@ -99,6 +126,11 @@ func (s *Server) List(ctx context.Context, req *pb.ListRequest) (*pb.ListRespons
func (s *Server) Delete(ctx context.Context, req *pb.DeleteRequest) (*pb.DeleteResponse, error) {
s.logger.Debug("entering netstate delete")
APIKeyBytes := []byte(req.APIKey)
if err := s.validateAuth(APIKeyBytes); err != nil {
return nil, err
}
err := s.DB.Delete(req.Path)
if err != nil {
s.logger.Error("err deleting pointer entry", zap.Error(err))

View File

@ -5,11 +5,25 @@ package netstate
import (
"bytes"
"os"
"testing"
"github.com/spf13/viper"
"storj.io/storj/storage/boltdb"
)
// MockDB mocks db functionality for testing
const (
API_KEY = "abc123"
)
func TestMain(m *testing.M) {
viper.SetEnvPrefix("API")
os.Setenv("API_KEY", API_KEY)
viper.AutomaticEnv()
os.Exit(m.Run())
}
type MockDB struct {
timesCalled int
puts []boltdb.PointerEntry

View File

@ -1,33 +1,12 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: netstate.proto
/*
Package netstate is a generated protocol buffer package.
It is generated from these files:
netstate.proto
It has these top-level messages:
RedundancyScheme
EncryptionScheme
RemotePiece
RemoteSegment
Pointer
PutRequest
GetRequest
ListRequest
PutResponse
GetResponse
ListResponse
DeleteRequest
DeleteResponse
*/
package netstate
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/timestamp"
import timestamp "github.com/golang/protobuf/ptypes/timestamp"
import (
context "golang.org/x/net/context"
@ -62,7 +41,7 @@ func (x RedundancyScheme_SchemeType) String() string {
return proto.EnumName(RedundancyScheme_SchemeType_name, int32(x))
}
func (RedundancyScheme_SchemeType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{0, 0}
return fileDescriptor_netstate_503318c39d13509f, []int{0, 0}
}
type EncryptionScheme_EncryptionType int32
@ -85,7 +64,7 @@ func (x EncryptionScheme_EncryptionType) String() string {
return proto.EnumName(EncryptionScheme_EncryptionType_name, int32(x))
}
func (EncryptionScheme_EncryptionType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor0, []int{1, 0}
return fileDescriptor_netstate_503318c39d13509f, []int{1, 0}
}
type Pointer_DataType int32
@ -107,21 +86,45 @@ var Pointer_DataType_value = map[string]int32{
func (x Pointer_DataType) String() string {
return proto.EnumName(Pointer_DataType_name, int32(x))
}
func (Pointer_DataType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} }
func (Pointer_DataType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{4, 0}
}
type RedundancyScheme struct {
Type RedundancyScheme_SchemeType `protobuf:"varint,1,opt,name=type,enum=netstate.RedundancyScheme_SchemeType" json:"type,omitempty"`
// these values apply to RS encoding
MinReq int64 `protobuf:"varint,2,opt,name=min_req,json=minReq" json:"min_req,omitempty"`
Total int64 `protobuf:"varint,3,opt,name=total" json:"total,omitempty"`
RepairThreshold int64 `protobuf:"varint,4,opt,name=repair_threshold,json=repairThreshold" json:"repair_threshold,omitempty"`
SuccessThreshold int64 `protobuf:"varint,5,opt,name=success_threshold,json=successThreshold" json:"success_threshold,omitempty"`
MinReq int64 `protobuf:"varint,2,opt,name=min_req,json=minReq" json:"min_req,omitempty"`
Total int64 `protobuf:"varint,3,opt,name=total" json:"total,omitempty"`
RepairThreshold int64 `protobuf:"varint,4,opt,name=repair_threshold,json=repairThreshold" json:"repair_threshold,omitempty"`
SuccessThreshold int64 `protobuf:"varint,5,opt,name=success_threshold,json=successThreshold" json:"success_threshold,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RedundancyScheme) Reset() { *m = RedundancyScheme{} }
func (m *RedundancyScheme) String() string { return proto.CompactTextString(m) }
func (*RedundancyScheme) ProtoMessage() {}
func (*RedundancyScheme) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *RedundancyScheme) Reset() { *m = RedundancyScheme{} }
func (m *RedundancyScheme) String() string { return proto.CompactTextString(m) }
func (*RedundancyScheme) ProtoMessage() {}
func (*RedundancyScheme) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{0}
}
func (m *RedundancyScheme) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RedundancyScheme.Unmarshal(m, b)
}
func (m *RedundancyScheme) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RedundancyScheme.Marshal(b, m, deterministic)
}
func (dst *RedundancyScheme) XXX_Merge(src proto.Message) {
xxx_messageInfo_RedundancyScheme.Merge(dst, src)
}
func (m *RedundancyScheme) XXX_Size() int {
return xxx_messageInfo_RedundancyScheme.Size(m)
}
func (m *RedundancyScheme) XXX_DiscardUnknown() {
xxx_messageInfo_RedundancyScheme.DiscardUnknown(m)
}
var xxx_messageInfo_RedundancyScheme proto.InternalMessageInfo
func (m *RedundancyScheme) GetType() RedundancyScheme_SchemeType {
if m != nil {
@ -162,12 +165,34 @@ type EncryptionScheme struct {
Type EncryptionScheme_EncryptionType `protobuf:"varint,1,opt,name=type,enum=netstate.EncryptionScheme_EncryptionType" json:"type,omitempty"`
EncryptedEncryptionKey []byte `protobuf:"bytes,2,opt,name=encrypted_encryption_key,json=encryptedEncryptionKey,proto3" json:"encrypted_encryption_key,omitempty"`
EncryptedStartingNonce []byte `protobuf:"bytes,3,opt,name=encrypted_starting_nonce,json=encryptedStartingNonce,proto3" json:"encrypted_starting_nonce,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *EncryptionScheme) Reset() { *m = EncryptionScheme{} }
func (m *EncryptionScheme) String() string { return proto.CompactTextString(m) }
func (*EncryptionScheme) ProtoMessage() {}
func (*EncryptionScheme) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *EncryptionScheme) Reset() { *m = EncryptionScheme{} }
func (m *EncryptionScheme) String() string { return proto.CompactTextString(m) }
func (*EncryptionScheme) ProtoMessage() {}
func (*EncryptionScheme) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{1}
}
func (m *EncryptionScheme) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_EncryptionScheme.Unmarshal(m, b)
}
func (m *EncryptionScheme) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_EncryptionScheme.Marshal(b, m, deterministic)
}
func (dst *EncryptionScheme) XXX_Merge(src proto.Message) {
xxx_messageInfo_EncryptionScheme.Merge(dst, src)
}
func (m *EncryptionScheme) XXX_Size() int {
return xxx_messageInfo_EncryptionScheme.Size(m)
}
func (m *EncryptionScheme) XXX_DiscardUnknown() {
xxx_messageInfo_EncryptionScheme.DiscardUnknown(m)
}
var xxx_messageInfo_EncryptionScheme proto.InternalMessageInfo
func (m *EncryptionScheme) GetType() EncryptionScheme_EncryptionType {
if m != nil {
@ -191,15 +216,37 @@ func (m *EncryptionScheme) GetEncryptedStartingNonce() []byte {
}
type RemotePiece struct {
PieceNum int64 `protobuf:"varint,1,opt,name=piece_num,json=pieceNum" json:"piece_num,omitempty"`
NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId" json:"node_id,omitempty"`
Size int64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"`
PieceNum int64 `protobuf:"varint,1,opt,name=piece_num,json=pieceNum" json:"piece_num,omitempty"`
NodeId string `protobuf:"bytes,2,opt,name=node_id,json=nodeId" json:"node_id,omitempty"`
Size int64 `protobuf:"varint,3,opt,name=size" json:"size,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RemotePiece) Reset() { *m = RemotePiece{} }
func (m *RemotePiece) String() string { return proto.CompactTextString(m) }
func (*RemotePiece) ProtoMessage() {}
func (*RemotePiece) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
func (m *RemotePiece) Reset() { *m = RemotePiece{} }
func (m *RemotePiece) String() string { return proto.CompactTextString(m) }
func (*RemotePiece) ProtoMessage() {}
func (*RemotePiece) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{2}
}
func (m *RemotePiece) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemotePiece.Unmarshal(m, b)
}
func (m *RemotePiece) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RemotePiece.Marshal(b, m, deterministic)
}
func (dst *RemotePiece) XXX_Merge(src proto.Message) {
xxx_messageInfo_RemotePiece.Merge(dst, src)
}
func (m *RemotePiece) XXX_Size() int {
return xxx_messageInfo_RemotePiece.Size(m)
}
func (m *RemotePiece) XXX_DiscardUnknown() {
xxx_messageInfo_RemotePiece.DiscardUnknown(m)
}
var xxx_messageInfo_RemotePiece proto.InternalMessageInfo
func (m *RemotePiece) GetPieceNum() int64 {
if m != nil {
@ -223,17 +270,39 @@ func (m *RemotePiece) GetSize() int64 {
}
type RemoteSegment struct {
Redundancy *RedundancyScheme `protobuf:"bytes,1,opt,name=redundancy" json:"redundancy,omitempty"`
PieceName string `protobuf:"bytes,2,opt,name=piece_name,json=pieceName" json:"piece_name,omitempty"`
RemotePieces []*RemotePiece `protobuf:"bytes,3,rep,name=remote_pieces,json=remotePieces" json:"remote_pieces,omitempty"`
MerkleRoot []byte `protobuf:"bytes,4,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"`
MerkleSize int64 `protobuf:"varint,5,opt,name=merkle_size,json=merkleSize" json:"merkle_size,omitempty"`
Redundancy *RedundancyScheme `protobuf:"bytes,1,opt,name=redundancy" json:"redundancy,omitempty"`
PieceName string `protobuf:"bytes,2,opt,name=piece_name,json=pieceName" json:"piece_name,omitempty"`
RemotePieces []*RemotePiece `protobuf:"bytes,3,rep,name=remote_pieces,json=remotePieces" json:"remote_pieces,omitempty"`
MerkleRoot []byte `protobuf:"bytes,4,opt,name=merkle_root,json=merkleRoot,proto3" json:"merkle_root,omitempty"`
MerkleSize int64 `protobuf:"varint,5,opt,name=merkle_size,json=merkleSize" json:"merkle_size,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *RemoteSegment) Reset() { *m = RemoteSegment{} }
func (m *RemoteSegment) String() string { return proto.CompactTextString(m) }
func (*RemoteSegment) ProtoMessage() {}
func (*RemoteSegment) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *RemoteSegment) Reset() { *m = RemoteSegment{} }
func (m *RemoteSegment) String() string { return proto.CompactTextString(m) }
func (*RemoteSegment) ProtoMessage() {}
func (*RemoteSegment) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{3}
}
func (m *RemoteSegment) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_RemoteSegment.Unmarshal(m, b)
}
func (m *RemoteSegment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_RemoteSegment.Marshal(b, m, deterministic)
}
func (dst *RemoteSegment) XXX_Merge(src proto.Message) {
xxx_messageInfo_RemoteSegment.Merge(dst, src)
}
func (m *RemoteSegment) XXX_Size() int {
return xxx_messageInfo_RemoteSegment.Size(m)
}
func (m *RemoteSegment) XXX_DiscardUnknown() {
xxx_messageInfo_RemoteSegment.DiscardUnknown(m)
}
var xxx_messageInfo_RemoteSegment proto.InternalMessageInfo
func (m *RemoteSegment) GetRedundancy() *RedundancyScheme {
if m != nil {
@ -271,19 +340,41 @@ func (m *RemoteSegment) GetMerkleSize() int64 {
}
type Pointer struct {
Type Pointer_DataType `protobuf:"varint,1,opt,name=type,enum=netstate.Pointer_DataType" json:"type,omitempty"`
Encryption *EncryptionScheme `protobuf:"bytes,2,opt,name=encryption" json:"encryption,omitempty"`
InlineSegment []byte `protobuf:"bytes,3,opt,name=inline_segment,json=inlineSegment,proto3" json:"inline_segment,omitempty"`
Remote *RemoteSegment `protobuf:"bytes,4,opt,name=remote" json:"remote,omitempty"`
EncryptedUnencryptedSize []byte `protobuf:"bytes,5,opt,name=encrypted_unencrypted_size,json=encryptedUnencryptedSize,proto3" json:"encrypted_unencrypted_size,omitempty"`
CreationDate *google_protobuf.Timestamp `protobuf:"bytes,6,opt,name=creation_date,json=creationDate" json:"creation_date,omitempty"`
ExpirationDate *google_protobuf.Timestamp `protobuf:"bytes,7,opt,name=expiration_date,json=expirationDate" json:"expiration_date,omitempty"`
Type Pointer_DataType `protobuf:"varint,1,opt,name=type,enum=netstate.Pointer_DataType" json:"type,omitempty"`
Encryption *EncryptionScheme `protobuf:"bytes,2,opt,name=encryption" json:"encryption,omitempty"`
InlineSegment []byte `protobuf:"bytes,3,opt,name=inline_segment,json=inlineSegment,proto3" json:"inline_segment,omitempty"`
Remote *RemoteSegment `protobuf:"bytes,4,opt,name=remote" json:"remote,omitempty"`
EncryptedUnencryptedSize []byte `protobuf:"bytes,5,opt,name=encrypted_unencrypted_size,json=encryptedUnencryptedSize,proto3" json:"encrypted_unencrypted_size,omitempty"`
CreationDate *timestamp.Timestamp `protobuf:"bytes,6,opt,name=creation_date,json=creationDate" json:"creation_date,omitempty"`
ExpirationDate *timestamp.Timestamp `protobuf:"bytes,7,opt,name=expiration_date,json=expirationDate" json:"expiration_date,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Pointer) Reset() { *m = Pointer{} }
func (m *Pointer) String() string { return proto.CompactTextString(m) }
func (*Pointer) ProtoMessage() {}
func (*Pointer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} }
func (m *Pointer) Reset() { *m = Pointer{} }
func (m *Pointer) String() string { return proto.CompactTextString(m) }
func (*Pointer) ProtoMessage() {}
func (*Pointer) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{4}
}
func (m *Pointer) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Pointer.Unmarshal(m, b)
}
func (m *Pointer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Pointer.Marshal(b, m, deterministic)
}
func (dst *Pointer) XXX_Merge(src proto.Message) {
xxx_messageInfo_Pointer.Merge(dst, src)
}
func (m *Pointer) XXX_Size() int {
return xxx_messageInfo_Pointer.Size(m)
}
func (m *Pointer) XXX_DiscardUnknown() {
xxx_messageInfo_Pointer.DiscardUnknown(m)
}
var xxx_messageInfo_Pointer proto.InternalMessageInfo
func (m *Pointer) GetType() Pointer_DataType {
if m != nil {
@ -320,14 +411,14 @@ func (m *Pointer) GetEncryptedUnencryptedSize() []byte {
return nil
}
func (m *Pointer) GetCreationDate() *google_protobuf.Timestamp {
func (m *Pointer) GetCreationDate() *timestamp.Timestamp {
if m != nil {
return m.CreationDate
}
return nil
}
func (m *Pointer) GetExpirationDate() *google_protobuf.Timestamp {
func (m *Pointer) GetExpirationDate() *timestamp.Timestamp {
if m != nil {
return m.ExpirationDate
}
@ -336,14 +427,37 @@ func (m *Pointer) GetExpirationDate() *google_protobuf.Timestamp {
// PutRequest is a request message for the Put rpc call
type PutRequest struct {
Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Pointer *Pointer `protobuf:"bytes,2,opt,name=pointer" json:"pointer,omitempty"`
Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Pointer *Pointer `protobuf:"bytes,2,opt,name=pointer" json:"pointer,omitempty"`
APIKey []byte `protobuf:"bytes,3,opt,name=APIKey,proto3" json:"APIKey,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} }
func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
func (*PutRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{5}
}
func (m *PutRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PutRequest.Unmarshal(m, b)
}
func (m *PutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PutRequest.Marshal(b, m, deterministic)
}
func (dst *PutRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_PutRequest.Merge(dst, src)
}
func (m *PutRequest) XXX_Size() int {
return xxx_messageInfo_PutRequest.Size(m)
}
func (m *PutRequest) XXX_DiscardUnknown() {
xxx_messageInfo_PutRequest.DiscardUnknown(m)
}
var xxx_messageInfo_PutRequest proto.InternalMessageInfo
func (m *PutRequest) GetPath() []byte {
if m != nil {
@ -359,15 +473,45 @@ func (m *PutRequest) GetPointer() *Pointer {
return nil
}
// GetRequest is a request message for the Get rpc call
type GetRequest struct {
Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
func (m *PutRequest) GetAPIKey() []byte {
if m != nil {
return m.APIKey
}
return nil
}
func (m *GetRequest) Reset() { *m = GetRequest{} }
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
func (*GetRequest) ProtoMessage() {}
func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} }
// GetRequest is a request message for the Get rpc call
type GetRequest struct {
Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
APIKey []byte `protobuf:"bytes,2,opt,name=APIKey,proto3" json:"APIKey,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetRequest) Reset() { *m = GetRequest{} }
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
func (*GetRequest) ProtoMessage() {}
func (*GetRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{6}
}
func (m *GetRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetRequest.Unmarshal(m, b)
}
func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic)
}
func (dst *GetRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetRequest.Merge(dst, src)
}
func (m *GetRequest) XXX_Size() int {
return xxx_messageInfo_GetRequest.Size(m)
}
func (m *GetRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetRequest proto.InternalMessageInfo
func (m *GetRequest) GetPath() []byte {
if m != nil {
@ -376,16 +520,46 @@ func (m *GetRequest) GetPath() []byte {
return nil
}
// ListRequest is a request message for the List rpc call
type ListRequest struct {
StartingPathKey []byte `protobuf:"bytes,1,opt,name=starting_path_key,json=startingPathKey,proto3" json:"starting_path_key,omitempty"`
Limit int64 `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"`
func (m *GetRequest) GetAPIKey() []byte {
if m != nil {
return m.APIKey
}
return nil
}
func (m *ListRequest) Reset() { *m = ListRequest{} }
func (m *ListRequest) String() string { return proto.CompactTextString(m) }
func (*ListRequest) ProtoMessage() {}
func (*ListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} }
// ListRequest is a request message for the List rpc call
type ListRequest struct {
StartingPathKey []byte `protobuf:"bytes,1,opt,name=starting_path_key,json=startingPathKey,proto3" json:"starting_path_key,omitempty"`
Limit int64 `protobuf:"varint,2,opt,name=limit" json:"limit,omitempty"`
APIKey []byte `protobuf:"bytes,3,opt,name=APIKey,proto3" json:"APIKey,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListRequest) Reset() { *m = ListRequest{} }
func (m *ListRequest) String() string { return proto.CompactTextString(m) }
func (*ListRequest) ProtoMessage() {}
func (*ListRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{7}
}
func (m *ListRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListRequest.Unmarshal(m, b)
}
func (m *ListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListRequest.Marshal(b, m, deterministic)
}
func (dst *ListRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListRequest.Merge(dst, src)
}
func (m *ListRequest) XXX_Size() int {
return xxx_messageInfo_ListRequest.Size(m)
}
func (m *ListRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListRequest proto.InternalMessageInfo
func (m *ListRequest) GetStartingPathKey() []byte {
if m != nil {
@ -401,24 +575,75 @@ func (m *ListRequest) GetLimit() int64 {
return 0
}
// PutResponse is a response message for the Put rpc call
type PutResponse struct {
func (m *ListRequest) GetAPIKey() []byte {
if m != nil {
return m.APIKey
}
return nil
}
func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} }
// PutResponse is a response message for the Put rpc call
type PutResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (*PutResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{8}
}
func (m *PutResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_PutResponse.Unmarshal(m, b)
}
func (m *PutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_PutResponse.Marshal(b, m, deterministic)
}
func (dst *PutResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_PutResponse.Merge(dst, src)
}
func (m *PutResponse) XXX_Size() int {
return xxx_messageInfo_PutResponse.Size(m)
}
func (m *PutResponse) XXX_DiscardUnknown() {
xxx_messageInfo_PutResponse.DiscardUnknown(m)
}
var xxx_messageInfo_PutResponse proto.InternalMessageInfo
// GetResponse is a response message for the Get rpc call
type GetResponse struct {
Pointer []byte `protobuf:"bytes,1,opt,name=pointer,proto3" json:"pointer,omitempty"`
Pointer []byte `protobuf:"bytes,1,opt,name=pointer,proto3" json:"pointer,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetResponse) Reset() { *m = GetResponse{} }
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
func (*GetResponse) ProtoMessage() {}
func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} }
func (m *GetResponse) Reset() { *m = GetResponse{} }
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
func (*GetResponse) ProtoMessage() {}
func (*GetResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{9}
}
func (m *GetResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetResponse.Unmarshal(m, b)
}
func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetResponse.Marshal(b, m, deterministic)
}
func (dst *GetResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetResponse.Merge(dst, src)
}
func (m *GetResponse) XXX_Size() int {
return xxx_messageInfo_GetResponse.Size(m)
}
func (m *GetResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetResponse proto.InternalMessageInfo
func (m *GetResponse) GetPointer() []byte {
if m != nil {
@ -429,13 +654,35 @@ func (m *GetResponse) GetPointer() []byte {
// ListResponse is a response message for the List rpc call
type ListResponse struct {
Paths [][]byte `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"`
Paths [][]byte `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListResponse) Reset() { *m = ListResponse{} }
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage() {}
func (*ListResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} }
func (m *ListResponse) Reset() { *m = ListResponse{} }
func (m *ListResponse) String() string { return proto.CompactTextString(m) }
func (*ListResponse) ProtoMessage() {}
func (*ListResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{10}
}
func (m *ListResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListResponse.Unmarshal(m, b)
}
func (m *ListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListResponse.Marshal(b, m, deterministic)
}
func (dst *ListResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListResponse.Merge(dst, src)
}
func (m *ListResponse) XXX_Size() int {
return xxx_messageInfo_ListResponse.Size(m)
}
func (m *ListResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListResponse proto.InternalMessageInfo
func (m *ListResponse) GetPaths() [][]byte {
if m != nil {
@ -445,13 +692,36 @@ func (m *ListResponse) GetPaths() [][]byte {
}
type DeleteRequest struct {
Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
APIKey []byte `protobuf:"bytes,2,opt,name=APIKey,proto3" json:"APIKey,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} }
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{11}
}
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteRequest.Unmarshal(m, b)
}
func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteRequest.Marshal(b, m, deterministic)
}
func (dst *DeleteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteRequest.Merge(dst, src)
}
func (m *DeleteRequest) XXX_Size() int {
return xxx_messageInfo_DeleteRequest.Size(m)
}
func (m *DeleteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteRequest.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteRequest proto.InternalMessageInfo
func (m *DeleteRequest) GetPath() []byte {
if m != nil {
@ -460,14 +730,43 @@ func (m *DeleteRequest) GetPath() []byte {
return nil
}
// DeleteResponse is a response message for the Delete rpc call
type DeleteResponse struct {
func (m *DeleteRequest) GetAPIKey() []byte {
if m != nil {
return m.APIKey
}
return nil
}
func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteResponse) ProtoMessage() {}
func (*DeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} }
// DeleteResponse is a response message for the Delete rpc call
type DeleteResponse struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteResponse) ProtoMessage() {}
func (*DeleteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_netstate_503318c39d13509f, []int{12}
}
func (m *DeleteResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_DeleteResponse.Unmarshal(m, b)
}
func (m *DeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_DeleteResponse.Marshal(b, m, deterministic)
}
func (dst *DeleteResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_DeleteResponse.Merge(dst, src)
}
func (m *DeleteResponse) XXX_Size() int {
return xxx_messageInfo_DeleteResponse.Size(m)
}
func (m *DeleteResponse) XXX_DiscardUnknown() {
xxx_messageInfo_DeleteResponse.DiscardUnknown(m)
}
var xxx_messageInfo_DeleteResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*RedundancyScheme)(nil), "netstate.RedundancyScheme")
@ -496,8 +795,9 @@ var _ grpc.ClientConn
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for NetState service
// NetStateClient is the client API for NetState service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type NetStateClient interface {
// Put formats and hands off a file path to be saved to boltdb
Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
@ -519,7 +819,7 @@ func NewNetStateClient(cc *grpc.ClientConn) NetStateClient {
func (c *netStateClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error) {
out := new(PutResponse)
err := grpc.Invoke(ctx, "/netstate.NetState/Put", in, out, c.cc, opts...)
err := c.cc.Invoke(ctx, "/netstate.NetState/Put", in, out, opts...)
if err != nil {
return nil, err
}
@ -528,7 +828,7 @@ func (c *netStateClient) Put(ctx context.Context, in *PutRequest, opts ...grpc.C
func (c *netStateClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
out := new(GetResponse)
err := grpc.Invoke(ctx, "/netstate.NetState/Get", in, out, c.cc, opts...)
err := c.cc.Invoke(ctx, "/netstate.NetState/Get", in, out, opts...)
if err != nil {
return nil, err
}
@ -537,7 +837,7 @@ func (c *netStateClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.C
func (c *netStateClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
out := new(ListResponse)
err := grpc.Invoke(ctx, "/netstate.NetState/List", in, out, c.cc, opts...)
err := c.cc.Invoke(ctx, "/netstate.NetState/List", in, out, opts...)
if err != nil {
return nil, err
}
@ -546,7 +846,7 @@ func (c *netStateClient) List(ctx context.Context, in *ListRequest, opts ...grpc
func (c *netStateClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
out := new(DeleteResponse)
err := grpc.Invoke(ctx, "/netstate.NetState/Delete", in, out, c.cc, opts...)
err := c.cc.Invoke(ctx, "/netstate.NetState/Delete", in, out, opts...)
if err != nil {
return nil, err
}
@ -667,61 +967,63 @@ var _NetState_serviceDesc = grpc.ServiceDesc{
Metadata: "netstate.proto",
}
func init() { proto.RegisterFile("netstate.proto", fileDescriptor0) }
func init() { proto.RegisterFile("netstate.proto", fileDescriptor_netstate_503318c39d13509f) }
var fileDescriptor0 = []byte{
// 847 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x54, 0x7f, 0x6f, 0xe3, 0x44,
0x10, 0xad, 0xcf, 0x6d, 0xda, 0x4e, 0x7e, 0xd4, 0x5d, 0xe5, 0xee, 0xac, 0x20, 0x44, 0x64, 0x38,
0xd1, 0xa3, 0x52, 0x90, 0x82, 0x90, 0xa0, 0x80, 0x10, 0xb4, 0x51, 0x55, 0x71, 0x4d, 0xa3, 0x4d,
0x10, 0xfc, 0x67, 0xf9, 0xe2, 0x21, 0xb1, 0x2e, 0xde, 0x75, 0xbd, 0x6b, 0x89, 0xf0, 0xbd, 0xf8,
0x4a, 0x08, 0xf1, 0x27, 0x9f, 0x00, 0x79, 0x77, 0x6d, 0x6f, 0x72, 0xe2, 0xee, 0xaf, 0xec, 0xcc,
0xbc, 0x99, 0xcc, 0x7b, 0xfb, 0xbc, 0xd0, 0x63, 0x28, 0x85, 0x8c, 0x24, 0x8e, 0xb2, 0x9c, 0x4b,
0x4e, 0x4e, 0xaa, 0x78, 0x70, 0x26, 0x93, 0x14, 0x85, 0x8c, 0xd2, 0x4c, 0x97, 0x82, 0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escriptor_netstate_503318c39d13509f = []byte{
// 868 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0x7f, 0x6b, 0xe3, 0x46,
0x10, 0x8d, 0xa2, 0x44, 0x49, 0xc6, 0x3f, 0xa2, 0x2c, 0xbe, 0x9c, 0x70, 0x29, 0x0d, 0xa2, 0x47,
0x73, 0x0d, 0xb8, 0xe0, 0x52, 0xb8, 0xe6, 0x5a, 0xca, 0x35, 0x31, 0x21, 0xdc, 0x9d, 0xcf, 0xac,
0x5d, 0xda, 0xff, 0x84, 0xce, 0x9e, 0xda, 0xe2, 0xac, 0x5d, 0x45, 0xbb, 0x82, 0xba, 0xdf, 0xab,
0x5f, 0xa9, 0x94, 0xfe, 0xd9, 0x4f, 0x50, 0xb4, 0xbb, 0x92, 0xd6, 0x3e, 0xae, 0x85, 0xfb, 0xcb,
0x9a, 0xd9, 0xf7, 0x66, 0xe7, 0xcd, 0x3c, 0x2f, 0x74, 0x19, 0x4a, 0x21, 0x63, 0x89, 0x83, 0x2c,
0xe7, 0x92, 0x93, 0xe3, 0x2a, 0xee, 0x9f, 0xca, 0x24, 0x45, 0x21, 0xe3, 0x34, 0xd3, 0x47, 0xe1,
0xdf, 0x0e, 0xf8, 0x14, 0x17, 0x05, 0x5b, 0xc4, 0x6c, 0xbe, 0x99, 0xce, 0x57, 0x98, 0x22, 0xf9,
0x16, 0x0e, 0xe4, 0x26, 0xc3, 0xc0, 0xb9, 0x70, 0x2e, 0xbb, 0xc3, 0x27, 0x83, 0xba, 0xdc, 0x2e,
0x72, 0xa0, 0x7f, 0x66, 0x9b, 0x0c, 0xa9, 0xa2, 0x90, 0xc7, 0x70, 0x94, 0x26, 0x2c, 0xca, 0xf1,
0x21, 0xd8, 0xbf, 0x70, 0x2e, 0x5d, 0xea, 0xa5, 0x09, 0xa3, 0xf8, 0x40, 0x7a, 0x70, 0x28, 0xb9,
0x8c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x32, 0xce, 0x04, 0x86, 0x5f,
0x40, 0x4b, 0x75, 0xac, 0x43, 0x12, 0x34, 0x53, 0xd0, 0xb7, 0x55, 0x61, 0xf8, 0x39, 0xb4, 0x75,
0x83, 0x06, 0xd9, 0x83, 0xc3, 0xb2, 0x31, 0x11, 0x38, 0x17, 0xee, 0x65, 0x9b, 0xea, 0x20, 0x7c,
0x0e, 0x9d, 0x5b, 0x5c, 0xa3, 0xc4, 0x8f, 0x99, 0x81, 0x0f, 0xdd, 0x8a, 0xac, 0x2f, 0x19, 0xfe,
0xe9, 0xc0, 0xf1, 0x18, 0xe5, 0xb4, 0xdc, 0x02, 0x19, 0x82, 0x3b, 0x29, 0x24, 0xe9, 0x59, 0x7b,
0xa9, 0x57, 0xda, 0x7f, 0xb4, 0x93, 0x35, 0x5d, 0x0e, 0xc1, 0xbd, 0xc3, 0x2d, 0x4e, 0xb3, 0x1f,
0x9b, 0x63, 0xcf, 0xe0, 0x1b, 0x38, 0x28, 0x95, 0x12, 0xeb, 0xd8, 0x5a, 0x4d, 0xff, 0x7c, 0x37,
0x6d, 0x68, 0xcf, 0xc1, 0xd3, 0xdd, 0x13, 0xeb, 0x5f, 0xb7, 0x35, 0x8c, 0x7e, 0xf0, 0xfe, 0x81,
0x26, 0xbf, 0xf5, 0x94, 0xcf, 0xbf, 0xfe, 0x37, 0x00, 0x00, 0xff, 0xff, 0x43, 0x9b, 0xfa, 0x08,
0xb1, 0x07, 0x00, 0x00,
}

View File

@ -78,17 +78,20 @@ message Pointer {
message PutRequest {
bytes path = 1;
Pointer pointer = 2;
bytes APIKey = 3;
}
// GetRequest is a request message for the Get rpc call
message GetRequest {
bytes path = 1;
bytes APIKey = 2;
}
// ListRequest is a request message for the List rpc call
message ListRequest {
bytes starting_path_key = 1; // the Path key in the bucket to start listing
int64 limit = 2; // how many keys to list
bytes APIKey = 3;
}
// PutResponse is a response message for the Put rpc call
@ -107,6 +110,7 @@ message ListResponse {
message DeleteRequest {
bytes path = 1;
bytes APIKey = 2;
}
// DeleteResponse is a response message for the Delete rpc call