2018-11-20 17:09:35 +00:00
|
|
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
2018-09-18 05:39:06 +01:00
|
|
|
// source: piecestore.proto
|
2018-08-17 18:40:15 +01:00
|
|
|
|
2019-06-06 16:16:14 +01:00
|
|
|
package pbold
|
Added rpc server (#40)
* Added piecestore
* gofmt
* Added requested changes
* Added cli
* Removed ranger because I wanted something that can stand alone
* Add example of http server using piece store
* Changed piecestore code to make it more optial for error handelling
* Merged with piecestore
* Added missing package
* Forgot io import
* gofmt
* gofmt
* Forgot io
* Make path by hash exported
* updated to simplify again whoops
* Updated server to work real good
* Forgot ampersand
* Updated to match FilePiece
* Merged in cam's delete code
* Remove unused io
* Added RPC code
* Give the download request a reader
* Removed http server stuff; changed receive stream to say io.reader
* Added expiration date to shardInfo
* Change all instances of Shard to Piece; change protobuf name; moved client insance to outside functions
* added ttl info request
* Move scripts to http server pr; added close method for Retrieve api
* added rpc server tests for getting piece meta data and retrieval routes
* Resolved linter errors, moved to prc server to pkg, updated go.mod to use latest protobuf
* Imported cams test
* Bump gometalinter deadline
* WIP adding tests
* added tests for store and delete routes
* Add changes as requested by Kaloyan, also cleaned up some code
* Get the code actually working whoops
* More cleanup
* Separating database calls from api.go
* need to rename expiration
* Added some changes requested by JT
* Fix read size
* Fixed total amount to read
* added tests
* Simplify protobuf, add store tests, edited api to handle invalid stores properly, return errors instead of messages
* Moved rpc client and server to piece store
* Moved piecestore protobuf to the /protos folder
* Cleaned up messages
* Clean up linter errors
* Added missing sqlite import
* Add ability to do iterative reads and writes to pstore
* Incrementally read data
* Fix linter and import errors
* Solve linter Error
* Change return types
* begin test refactor
* refactored to implement only 1 db connection, moved SQLite row checking into separate function and removed defer on rows.Close(), fixed os.tempDir in rpc_test.go
* Cleaning up tests
* Added retrieve tests
* refactored delete tests
* Deleted old tests
* Updated cmd/piecestore to reflect changes to piecestore
* Refactored server tests and server/client store code
* gofmt
* WIP implementing TTL struct
* Read 4k at a time when Retrieving
* implemented ttl struct
* Accidentally removed fpiece dependency?
* Double resolve merge conflict
* Moved client to the examples since it is an example
* Change hash to id in protobuf. TODO: Change client and server to reflect these changes
* Update client and protobuf
* changed hash to id
* Handle eof properly in retrieve
* Id -> ID
* forgot to change import for client after moving
* Moved client and server main to examples
* Made changes requested by JT
* checkEntries is now private, created currentTime variable for checkEntries, added defer rows.Close()
* Print not fatal
* Handle overflow when reading from server
* added const IDLength
* removed types from comments
* Add reader/writer for download data from and uploading data to server
* goimports and comments
* fixed nits, casts, added OK const, DBCleanup now exits program on error
* Add stream reader and writer for server
* Fix errors
* i beforee except after c lol
* customizable data dir
* Forgot to rename variable
* customizable data dir
* Handle closing of server stream properly
* linter
* pass on inserting the same data twice
* linter
* linter
* Do the easy things JT asked for
* Handle overflow from reads properly; handle custom db path
* Handle overflow for server stream read; TODO Combine server and client stream reads
* Allow for TTL of 0 to stay forever
* Make Client cleaner for user
2018-06-02 19:14:59 +01:00
|
|
|
|
2018-12-14 20:17:30 +00:00
|
|
|
import (
|
2019-03-05 20:48:37 +00:00
|
|
|
fmt "fmt"
|
|
|
|
_ "github.com/gogo/protobuf/gogoproto"
|
|
|
|
proto "github.com/gogo/protobuf/proto"
|
|
|
|
_ "github.com/golang/protobuf/ptypes/duration"
|
|
|
|
math "math"
|
2019-06-06 16:16:14 +01:00
|
|
|
|
|
|
|
pb "storj.io/storj/pkg/pb"
|
2018-12-14 20:17:30 +00:00
|
|
|
)
|
Added rpc server (#40)
* Added piecestore
* gofmt
* Added requested changes
* Added cli
* Removed ranger because I wanted something that can stand alone
* Add example of http server using piece store
* Changed piecestore code to make it more optial for error handelling
* Merged with piecestore
* Added missing package
* Forgot io import
* gofmt
* gofmt
* Forgot io
* Make path by hash exported
* updated to simplify again whoops
* Updated server to work real good
* Forgot ampersand
* Updated to match FilePiece
* Merged in cam's delete code
* Remove unused io
* Added RPC code
* Give the download request a reader
* Removed http server stuff; changed receive stream to say io.reader
* Added expiration date to shardInfo
* Change all instances of Shard to Piece; change protobuf name; moved client insance to outside functions
* added ttl info request
* Move scripts to http server pr; added close method for Retrieve api
* added rpc server tests for getting piece meta data and retrieval routes
* Resolved linter errors, moved to prc server to pkg, updated go.mod to use latest protobuf
* Imported cams test
* Bump gometalinter deadline
* WIP adding tests
* added tests for store and delete routes
* Add changes as requested by Kaloyan, also cleaned up some code
* Get the code actually working whoops
* More cleanup
* Separating database calls from api.go
* need to rename expiration
* Added some changes requested by JT
* Fix read size
* Fixed total amount to read
* added tests
* Simplify protobuf, add store tests, edited api to handle invalid stores properly, return errors instead of messages
* Moved rpc client and server to piece store
* Moved piecestore protobuf to the /protos folder
* Cleaned up messages
* Clean up linter errors
* Added missing sqlite import
* Add ability to do iterative reads and writes to pstore
* Incrementally read data
* Fix linter and import errors
* Solve linter Error
* Change return types
* begin test refactor
* refactored to implement only 1 db connection, moved SQLite row checking into separate function and removed defer on rows.Close(), fixed os.tempDir in rpc_test.go
* Cleaning up tests
* Added retrieve tests
* refactored delete tests
* Deleted old tests
* Updated cmd/piecestore to reflect changes to piecestore
* Refactored server tests and server/client store code
* gofmt
* WIP implementing TTL struct
* Read 4k at a time when Retrieving
* implemented ttl struct
* Accidentally removed fpiece dependency?
* Double resolve merge conflict
* Moved client to the examples since it is an example
* Change hash to id in protobuf. TODO: Change client and server to reflect these changes
* Update client and protobuf
* changed hash to id
* Handle eof properly in retrieve
* Id -> ID
* forgot to change import for client after moving
* Moved client and server main to examples
* Made changes requested by JT
* checkEntries is now private, created currentTime variable for checkEntries, added defer rows.Close()
* Print not fatal
* Handle overflow when reading from server
* added const IDLength
* removed types from comments
* Add reader/writer for download data from and uploading data to server
* goimports and comments
* fixed nits, casts, added OK const, DBCleanup now exits program on error
* Add stream reader and writer for server
* Fix errors
* i beforee except after c lol
* customizable data dir
* Forgot to rename variable
* customizable data dir
* Handle closing of server stream properly
* linter
* pass on inserting the same data twice
* linter
* linter
* Do the easy things JT asked for
* Handle overflow from reads properly; handle custom db path
* Handle overflow for server stream read; TODO Combine server and client stream reads
* Allow for TTL of 0 to stay forever
* Make Client cleaner for user
2018-06-02 19:14:59 +01:00
|
|
|
|
2019-06-06 16:16:14 +01:00
|
|
|
//OrderLimit aliases PayerBandwidthAllocation
|
|
|
|
type OrderLimit = PayerBandwidthAllocation
|
|
|
|
|
|
|
|
//Order aliases RenterBandwidthAllocation
|
|
|
|
type Order = RenterBandwidthAllocation
|
|
|
|
|
Added rpc server (#40)
* Added piecestore
* gofmt
* Added requested changes
* Added cli
* Removed ranger because I wanted something that can stand alone
* Add example of http server using piece store
* Changed piecestore code to make it more optial for error handelling
* Merged with piecestore
* Added missing package
* Forgot io import
* gofmt
* gofmt
* Forgot io
* Make path by hash exported
* updated to simplify again whoops
* Updated server to work real good
* Forgot ampersand
* Updated to match FilePiece
* Merged in cam's delete code
* Remove unused io
* Added RPC code
* Give the download request a reader
* Removed http server stuff; changed receive stream to say io.reader
* Added expiration date to shardInfo
* Change all instances of Shard to Piece; change protobuf name; moved client insance to outside functions
* added ttl info request
* Move scripts to http server pr; added close method for Retrieve api
* added rpc server tests for getting piece meta data and retrieval routes
* Resolved linter errors, moved to prc server to pkg, updated go.mod to use latest protobuf
* Imported cams test
* Bump gometalinter deadline
* WIP adding tests
* added tests for store and delete routes
* Add changes as requested by Kaloyan, also cleaned up some code
* Get the code actually working whoops
* More cleanup
* Separating database calls from api.go
* need to rename expiration
* Added some changes requested by JT
* Fix read size
* Fixed total amount to read
* added tests
* Simplify protobuf, add store tests, edited api to handle invalid stores properly, return errors instead of messages
* Moved rpc client and server to piece store
* Moved piecestore protobuf to the /protos folder
* Cleaned up messages
* Clean up linter errors
* Added missing sqlite import
* Add ability to do iterative reads and writes to pstore
* Incrementally read data
* Fix linter and import errors
* Solve linter Error
* Change return types
* begin test refactor
* refactored to implement only 1 db connection, moved SQLite row checking into separate function and removed defer on rows.Close(), fixed os.tempDir in rpc_test.go
* Cleaning up tests
* Added retrieve tests
* refactored delete tests
* Deleted old tests
* Updated cmd/piecestore to reflect changes to piecestore
* Refactored server tests and server/client store code
* gofmt
* WIP implementing TTL struct
* Read 4k at a time when Retrieving
* implemented ttl struct
* Accidentally removed fpiece dependency?
* Double resolve merge conflict
* Moved client to the examples since it is an example
* Change hash to id in protobuf. TODO: Change client and server to reflect these changes
* Update client and protobuf
* changed hash to id
* Handle eof properly in retrieve
* Id -> ID
* forgot to change import for client after moving
* Moved client and server main to examples
* Made changes requested by JT
* checkEntries is now private, created currentTime variable for checkEntries, added defer rows.Close()
* Print not fatal
* Handle overflow when reading from server
* added const IDLength
* removed types from comments
* Add reader/writer for download data from and uploading data to server
* goimports and comments
* fixed nits, casts, added OK const, DBCleanup now exits program on error
* Add stream reader and writer for server
* Fix errors
* i beforee except after c lol
* customizable data dir
* Forgot to rename variable
* customizable data dir
* Handle closing of server stream properly
* linter
* pass on inserting the same data twice
* linter
* linter
* Do the easy things JT asked for
* Handle overflow from reads properly; handle custom db path
* Handle overflow for server stream read; TODO Combine server and client stream reads
* Allow for TTL of 0 to stay forever
* Make Client cleaner for user
2018-06-02 19:14:59 +01:00
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
|
var _ = proto.Marshal
|
|
|
|
var _ = fmt.Errorf
|
|
|
|
var _ = math.Inf
|
|
|
|
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
|
|
// is compatible with the proto package it is being compiled against.
|
|
|
|
// A compilation error at this line likely means your copy of the
|
|
|
|
// proto package needs to be updated.
|
2018-11-20 17:09:35 +00:00
|
|
|
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
|
Added rpc server (#40)
* Added piecestore
* gofmt
* Added requested changes
* Added cli
* Removed ranger because I wanted something that can stand alone
* Add example of http server using piece store
* Changed piecestore code to make it more optial for error handelling
* Merged with piecestore
* Added missing package
* Forgot io import
* gofmt
* gofmt
* Forgot io
* Make path by hash exported
* updated to simplify again whoops
* Updated server to work real good
* Forgot ampersand
* Updated to match FilePiece
* Merged in cam's delete code
* Remove unused io
* Added RPC code
* Give the download request a reader
* Removed http server stuff; changed receive stream to say io.reader
* Added expiration date to shardInfo
* Change all instances of Shard to Piece; change protobuf name; moved client insance to outside functions
* added ttl info request
* Move scripts to http server pr; added close method for Retrieve api
* added rpc server tests for getting piece meta data and retrieval routes
* Resolved linter errors, moved to prc server to pkg, updated go.mod to use latest protobuf
* Imported cams test
* Bump gometalinter deadline
* WIP adding tests
* added tests for store and delete routes
* Add changes as requested by Kaloyan, also cleaned up some code
* Get the code actually working whoops
* More cleanup
* Separating database calls from api.go
* need to rename expiration
* Added some changes requested by JT
* Fix read size
* Fixed total amount to read
* added tests
* Simplify protobuf, add store tests, edited api to handle invalid stores properly, return errors instead of messages
* Moved rpc client and server to piece store
* Moved piecestore protobuf to the /protos folder
* Cleaned up messages
* Clean up linter errors
* Added missing sqlite import
* Add ability to do iterative reads and writes to pstore
* Incrementally read data
* Fix linter and import errors
* Solve linter Error
* Change return types
* begin test refactor
* refactored to implement only 1 db connection, moved SQLite row checking into separate function and removed defer on rows.Close(), fixed os.tempDir in rpc_test.go
* Cleaning up tests
* Added retrieve tests
* refactored delete tests
* Deleted old tests
* Updated cmd/piecestore to reflect changes to piecestore
* Refactored server tests and server/client store code
* gofmt
* WIP implementing TTL struct
* Read 4k at a time when Retrieving
* implemented ttl struct
* Accidentally removed fpiece dependency?
* Double resolve merge conflict
* Moved client to the examples since it is an example
* Change hash to id in protobuf. TODO: Change client and server to reflect these changes
* Update client and protobuf
* changed hash to id
* Handle eof properly in retrieve
* Id -> ID
* forgot to change import for client after moving
* Moved client and server main to examples
* Made changes requested by JT
* checkEntries is now private, created currentTime variable for checkEntries, added defer rows.Close()
* Print not fatal
* Handle overflow when reading from server
* added const IDLength
* removed types from comments
* Add reader/writer for download data from and uploading data to server
* goimports and comments
* fixed nits, casts, added OK const, DBCleanup now exits program on error
* Add stream reader and writer for server
* Fix errors
* i beforee except after c lol
* customizable data dir
* Forgot to rename variable
* customizable data dir
* Handle closing of server stream properly
* linter
* pass on inserting the same data twice
* linter
* linter
* Do the easy things JT asked for
* Handle overflow from reads properly; handle custom db path
* Handle overflow for server stream read; TODO Combine server and client stream reads
* Allow for TTL of 0 to stay forever
* Make Client cleaner for user
2018-06-02 19:14:59 +01:00
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
type BandwidthAction int32
|
2018-10-30 19:03:41 +00:00
|
|
|
|
|
|
|
const (
|
2019-01-28 19:45:25 +00:00
|
|
|
BandwidthAction_PUT BandwidthAction = 0
|
|
|
|
BandwidthAction_GET BandwidthAction = 1
|
|
|
|
BandwidthAction_GET_AUDIT BandwidthAction = 2
|
|
|
|
BandwidthAction_GET_REPAIR BandwidthAction = 3
|
|
|
|
BandwidthAction_PUT_REPAIR BandwidthAction = 4
|
2018-10-30 19:03:41 +00:00
|
|
|
)
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
var BandwidthAction_name = map[int32]string{
|
2018-10-30 19:03:41 +00:00
|
|
|
0: "PUT",
|
|
|
|
1: "GET",
|
2019-01-10 11:41:57 +00:00
|
|
|
2: "GET_AUDIT",
|
|
|
|
3: "GET_REPAIR",
|
|
|
|
4: "PUT_REPAIR",
|
2018-10-30 19:03:41 +00:00
|
|
|
}
|
2019-03-05 20:48:37 +00:00
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
var BandwidthAction_value = map[string]int32{
|
2019-01-10 11:41:57 +00:00
|
|
|
"PUT": 0,
|
|
|
|
"GET": 1,
|
|
|
|
"GET_AUDIT": 2,
|
|
|
|
"GET_REPAIR": 3,
|
|
|
|
"PUT_REPAIR": 4,
|
2018-10-30 19:03:41 +00:00
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (x BandwidthAction) String() string {
|
|
|
|
return proto.EnumName(BandwidthAction_name, int32(x))
|
2018-10-30 19:03:41 +00:00
|
|
|
}
|
2019-03-05 20:48:37 +00:00
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (BandwidthAction) EnumDescriptor() ([]byte, []int) {
|
2019-03-05 20:48:37 +00:00
|
|
|
return fileDescriptor_569d535d76469daf, []int{0}
|
2018-10-30 19:03:41 +00:00
|
|
|
}
|
|
|
|
|
2018-08-17 18:40:15 +01:00
|
|
|
type PayerBandwidthAllocation struct {
|
2019-06-06 16:16:14 +01:00
|
|
|
SatelliteId pb.NodeID `protobuf:"bytes,1,opt,name=satellite_id,json=satelliteId,proto3,customtype=NodeID" json:"satellite_id"`
|
|
|
|
UplinkId pb.NodeID `protobuf:"bytes,2,opt,name=uplink_id,json=uplinkId,proto3,customtype=NodeID" json:"uplink_id"`
|
2019-01-28 19:45:25 +00:00
|
|
|
MaxSize int64 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"`
|
|
|
|
ExpirationUnixSec int64 `protobuf:"varint,4,opt,name=expiration_unix_sec,json=expirationUnixSec,proto3" json:"expiration_unix_sec,omitempty"`
|
|
|
|
SerialNumber string `protobuf:"bytes,5,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"`
|
|
|
|
Action BandwidthAction `protobuf:"varint,6,opt,name=action,proto3,enum=piecestoreroutes.BandwidthAction" json:"action,omitempty"`
|
|
|
|
CreatedUnixSec int64 `protobuf:"varint,7,opt,name=created_unix_sec,json=createdUnixSec,proto3" json:"created_unix_sec,omitempty"`
|
|
|
|
Certs [][]byte `protobuf:"bytes,8,rep,name=certs,proto3" json:"certs,omitempty"`
|
|
|
|
Signature []byte `protobuf:"bytes,9,opt,name=signature,proto3" json:"signature,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PayerBandwidthAllocation) Reset() { *m = PayerBandwidthAllocation{} }
|
|
|
|
func (m *PayerBandwidthAllocation) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*PayerBandwidthAllocation) ProtoMessage() {}
|
|
|
|
func (*PayerBandwidthAllocation) Descriptor() ([]byte, []int) {
|
2019-03-05 20:48:37 +00:00
|
|
|
return fileDescriptor_569d535d76469daf, []int{0}
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
func (m *PayerBandwidthAllocation) XXX_Unmarshal(b []byte) error {
|
|
|
|
return xxx_messageInfo_PayerBandwidthAllocation.Unmarshal(m, b)
|
|
|
|
}
|
|
|
|
func (m *PayerBandwidthAllocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
return xxx_messageInfo_PayerBandwidthAllocation.Marshal(b, m, deterministic)
|
|
|
|
}
|
2019-03-05 20:48:37 +00:00
|
|
|
func (m *PayerBandwidthAllocation) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_PayerBandwidthAllocation.Merge(m, src)
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
func (m *PayerBandwidthAllocation) XXX_Size() int {
|
|
|
|
return xxx_messageInfo_PayerBandwidthAllocation.Size(m)
|
|
|
|
}
|
|
|
|
func (m *PayerBandwidthAllocation) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_PayerBandwidthAllocation.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_PayerBandwidthAllocation proto.InternalMessageInfo
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *PayerBandwidthAllocation) GetMaxSize() int64 {
|
2018-08-17 18:40:15 +01:00
|
|
|
if m != nil {
|
|
|
|
return m.MaxSize
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *PayerBandwidthAllocation) GetExpirationUnixSec() int64 {
|
2018-08-17 18:40:15 +01:00
|
|
|
if m != nil {
|
|
|
|
return m.ExpirationUnixSec
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *PayerBandwidthAllocation) GetSerialNumber() string {
|
2018-08-17 18:40:15 +01:00
|
|
|
if m != nil {
|
|
|
|
return m.SerialNumber
|
|
|
|
}
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *PayerBandwidthAllocation) GetAction() BandwidthAction {
|
2018-10-30 19:03:41 +00:00
|
|
|
if m != nil {
|
|
|
|
return m.Action
|
|
|
|
}
|
2019-01-28 19:45:25 +00:00
|
|
|
return BandwidthAction_PUT
|
2018-10-30 19:03:41 +00:00
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *PayerBandwidthAllocation) GetCreatedUnixSec() int64 {
|
2018-11-08 16:04:52 +00:00
|
|
|
if m != nil {
|
|
|
|
return m.CreatedUnixSec
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *PayerBandwidthAllocation) GetCerts() [][]byte {
|
|
|
|
if m != nil {
|
|
|
|
return m.Certs
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *PayerBandwidthAllocation) GetSignature() []byte {
|
|
|
|
if m != nil {
|
|
|
|
return m.Signature
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-08-17 18:40:15 +01:00
|
|
|
type RenterBandwidthAllocation struct {
|
2019-01-28 19:45:25 +00:00
|
|
|
PayerAllocation PayerBandwidthAllocation `protobuf:"bytes,1,opt,name=payer_allocation,json=payerAllocation,proto3" json:"payer_allocation"`
|
|
|
|
Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"`
|
2019-06-06 16:16:14 +01:00
|
|
|
StorageNodeId pb.NodeID `protobuf:"bytes,3,opt,name=storage_node_id,json=storageNodeId,proto3,customtype=NodeID" json:"storage_node_id"`
|
2019-01-28 19:45:25 +00:00
|
|
|
Certs [][]byte `protobuf:"bytes,4,rep,name=certs,proto3" json:"certs,omitempty"`
|
|
|
|
Signature []byte `protobuf:"bytes,5,opt,name=signature,proto3" json:"signature,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
func (m *RenterBandwidthAllocation) Reset() { *m = RenterBandwidthAllocation{} }
|
|
|
|
func (m *RenterBandwidthAllocation) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*RenterBandwidthAllocation) ProtoMessage() {}
|
|
|
|
func (*RenterBandwidthAllocation) Descriptor() ([]byte, []int) {
|
2019-03-05 20:48:37 +00:00
|
|
|
return fileDescriptor_569d535d76469daf, []int{1}
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
func (m *RenterBandwidthAllocation) XXX_Unmarshal(b []byte) error {
|
|
|
|
return xxx_messageInfo_RenterBandwidthAllocation.Unmarshal(m, b)
|
|
|
|
}
|
|
|
|
func (m *RenterBandwidthAllocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
return xxx_messageInfo_RenterBandwidthAllocation.Marshal(b, m, deterministic)
|
|
|
|
}
|
2019-03-05 20:48:37 +00:00
|
|
|
func (m *RenterBandwidthAllocation) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_RenterBandwidthAllocation.Merge(m, src)
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
func (m *RenterBandwidthAllocation) XXX_Size() int {
|
|
|
|
return xxx_messageInfo_RenterBandwidthAllocation.Size(m)
|
|
|
|
}
|
|
|
|
func (m *RenterBandwidthAllocation) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_RenterBandwidthAllocation.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_RenterBandwidthAllocation proto.InternalMessageInfo
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *RenterBandwidthAllocation) GetPayerAllocation() PayerBandwidthAllocation {
|
2019-01-25 18:05:21 +00:00
|
|
|
if m != nil {
|
2019-01-28 19:45:25 +00:00
|
|
|
return m.PayerAllocation
|
2019-01-25 18:05:21 +00:00
|
|
|
}
|
2019-01-28 19:45:25 +00:00
|
|
|
return PayerBandwidthAllocation{}
|
2019-01-25 18:05:21 +00:00
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *RenterBandwidthAllocation) GetTotal() int64 {
|
2018-08-17 18:40:15 +01:00
|
|
|
if m != nil {
|
2019-01-28 19:45:25 +00:00
|
|
|
return m.Total
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
2019-01-28 19:45:25 +00:00
|
|
|
return 0
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *RenterBandwidthAllocation) GetCerts() [][]byte {
|
2018-08-17 18:40:15 +01:00
|
|
|
if m != nil {
|
2019-01-28 19:45:25 +00:00
|
|
|
return m.Certs
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:45:25 +00:00
|
|
|
func (m *RenterBandwidthAllocation) GetSignature() []byte {
|
2018-08-17 18:40:15 +01:00
|
|
|
if m != nil {
|
2019-01-28 19:45:25 +00:00
|
|
|
return m.Signature
|
2018-08-17 18:40:15 +01:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-10-17 12:40:11 +01:00
|
|
|
type SignedMessage struct {
|
2018-10-11 15:35:55 +01:00
|
|
|
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
|
|
|
Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
|
2018-11-24 02:46:53 +00:00
|
|
|
PublicKey []byte `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
|
2018-10-11 15:35:55 +01:00
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) Reset() { *m = SignedMessage{} }
|
|
|
|
func (m *SignedMessage) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*SignedMessage) ProtoMessage() {}
|
|
|
|
func (*SignedMessage) Descriptor() ([]byte, []int) {
|
2019-03-29 14:40:06 +00:00
|
|
|
return fileDescriptor_569d535d76469daf, []int{2}
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) XXX_Unmarshal(b []byte) error {
|
|
|
|
return xxx_messageInfo_SignedMessage.Unmarshal(m, b)
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
return xxx_messageInfo_SignedMessage.Marshal(b, m, deterministic)
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|
2019-03-05 20:48:37 +00:00
|
|
|
func (m *SignedMessage) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_SignedMessage.Merge(m, src)
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) XXX_Size() int {
|
|
|
|
return xxx_messageInfo_SignedMessage.Size(m)
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_SignedMessage.DiscardUnknown(m)
|
2018-10-11 15:35:55 +01:00
|
|
|
}
|
|
|
|
|
2018-10-17 12:40:11 +01:00
|
|
|
var xxx_messageInfo_SignedMessage proto.InternalMessageInfo
|
2018-10-11 15:35:55 +01:00
|
|
|
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) GetData() []byte {
|
2018-10-11 15:35:55 +01:00
|
|
|
if m != nil {
|
|
|
|
return m.Data
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) GetSignature() []byte {
|
2018-10-11 15:35:55 +01:00
|
|
|
if m != nil {
|
|
|
|
return m.Signature
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2018-10-17 12:40:11 +01:00
|
|
|
func (m *SignedMessage) GetPublicKey() []byte {
|
2018-10-11 15:35:55 +01:00
|
|
|
if m != nil {
|
|
|
|
return m.PublicKey
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-02-23 10:46:07 +00:00
|
|
|
type SignedHash struct {
|
|
|
|
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
|
|
|
|
Certs [][]byte `protobuf:"bytes,2,rep,name=certs,proto3" json:"certs,omitempty"`
|
|
|
|
Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
|
|
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
|
|
XXX_unrecognized []byte `json:"-"`
|
|
|
|
XXX_sizecache int32 `json:"-"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *SignedHash) Reset() { *m = SignedHash{} }
|
|
|
|
func (m *SignedHash) String() string { return proto.CompactTextString(m) }
|
|
|
|
func (*SignedHash) ProtoMessage() {}
|
|
|
|
func (*SignedHash) Descriptor() ([]byte, []int) {
|
2019-03-29 14:40:06 +00:00
|
|
|
return fileDescriptor_569d535d76469daf, []int{3}
|
2019-02-23 10:46:07 +00:00
|
|
|
}
|
|
|
|
func (m *SignedHash) XXX_Unmarshal(b []byte) error {
|
|
|
|
return xxx_messageInfo_SignedHash.Unmarshal(m, b)
|
|
|
|
}
|
|
|
|
func (m *SignedHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
|
|
return xxx_messageInfo_SignedHash.Marshal(b, m, deterministic)
|
|
|
|
}
|
2019-03-05 20:48:37 +00:00
|
|
|
func (m *SignedHash) XXX_Merge(src proto.Message) {
|
|
|
|
xxx_messageInfo_SignedHash.Merge(m, src)
|
2019-02-23 10:46:07 +00:00
|
|
|
}
|
|
|
|
func (m *SignedHash) XXX_Size() int {
|
|
|
|
return xxx_messageInfo_SignedHash.Size(m)
|
|
|
|
}
|
|
|
|
func (m *SignedHash) XXX_DiscardUnknown() {
|
|
|
|
xxx_messageInfo_SignedHash.DiscardUnknown(m)
|
|
|
|
}
|
|
|
|
|
|
|
|
var xxx_messageInfo_SignedHash proto.InternalMessageInfo
|
|
|
|
|
|
|
|
func (m *SignedHash) GetHash() []byte {
|
|
|
|
if m != nil {
|
|
|
|
return m.Hash
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *SignedHash) GetCerts() [][]byte {
|
|
|
|
if m != nil {
|
|
|
|
return m.Certs
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *SignedHash) GetSignature() []byte {
|
|
|
|
if m != nil {
|
|
|
|
return m.Signature
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
Added rpc server (#40)
* Added piecestore
* gofmt
* Added requested changes
* Added cli
* Removed ranger because I wanted something that can stand alone
* Add example of http server using piece store
* Changed piecestore code to make it more optial for error handelling
* Merged with piecestore
* Added missing package
* Forgot io import
* gofmt
* gofmt
* Forgot io
* Make path by hash exported
* updated to simplify again whoops
* Updated server to work real good
* Forgot ampersand
* Updated to match FilePiece
* Merged in cam's delete code
* Remove unused io
* Added RPC code
* Give the download request a reader
* Removed http server stuff; changed receive stream to say io.reader
* Added expiration date to shardInfo
* Change all instances of Shard to Piece; change protobuf name; moved client insance to outside functions
* added ttl info request
* Move scripts to http server pr; added close method for Retrieve api
* added rpc server tests for getting piece meta data and retrieval routes
* Resolved linter errors, moved to prc server to pkg, updated go.mod to use latest protobuf
* Imported cams test
* Bump gometalinter deadline
* WIP adding tests
* added tests for store and delete routes
* Add changes as requested by Kaloyan, also cleaned up some code
* Get the code actually working whoops
* More cleanup
* Separating database calls from api.go
* need to rename expiration
* Added some changes requested by JT
* Fix read size
* Fixed total amount to read
* added tests
* Simplify protobuf, add store tests, edited api to handle invalid stores properly, return errors instead of messages
* Moved rpc client and server to piece store
* Moved piecestore protobuf to the /protos folder
* Cleaned up messages
* Clean up linter errors
* Added missing sqlite import
* Add ability to do iterative reads and writes to pstore
* Incrementally read data
* Fix linter and import errors
* Solve linter Error
* Change return types
* begin test refactor
* refactored to implement only 1 db connection, moved SQLite row checking into separate function and removed defer on rows.Close(), fixed os.tempDir in rpc_test.go
* Cleaning up tests
* Added retrieve tests
* refactored delete tests
* Deleted old tests
* Updated cmd/piecestore to reflect changes to piecestore
* Refactored server tests and server/client store code
* gofmt
* WIP implementing TTL struct
* Read 4k at a time when Retrieving
* implemented ttl struct
* Accidentally removed fpiece dependency?
* Double resolve merge conflict
* Moved client to the examples since it is an example
* Change hash to id in protobuf. TODO: Change client and server to reflect these changes
* Update client and protobuf
* changed hash to id
* Handle eof properly in retrieve
* Id -> ID
* forgot to change import for client after moving
* Moved client and server main to examples
* Made changes requested by JT
* checkEntries is now private, created currentTime variable for checkEntries, added defer rows.Close()
* Print not fatal
* Handle overflow when reading from server
* added const IDLength
* removed types from comments
* Add reader/writer for download data from and uploading data to server
* goimports and comments
* fixed nits, casts, added OK const, DBCleanup now exits program on error
* Add stream reader and writer for server
* Fix errors
* i beforee except after c lol
* customizable data dir
* Forgot to rename variable
* customizable data dir
* Handle closing of server stream properly
* linter
* pass on inserting the same data twice
* linter
* linter
* Do the easy things JT asked for
* Handle overflow from reads properly; handle custom db path
* Handle overflow for server stream read; TODO Combine server and client stream reads
* Allow for TTL of 0 to stay forever
* Make Client cleaner for user
2018-06-02 19:14:59 +01:00
|
|
|
func init() {
|
2019-03-05 20:48:37 +00:00
|
|
|
proto.RegisterEnum("piecestoreroutes.BandwidthAction", BandwidthAction_name, BandwidthAction_value)
|
2018-08-17 18:40:15 +01:00
|
|
|
proto.RegisterType((*PayerBandwidthAllocation)(nil), "piecestoreroutes.PayerBandwidthAllocation")
|
|
|
|
proto.RegisterType((*RenterBandwidthAllocation)(nil), "piecestoreroutes.RenterBandwidthAllocation")
|
2018-10-17 12:40:11 +01:00
|
|
|
proto.RegisterType((*SignedMessage)(nil), "piecestoreroutes.SignedMessage")
|
2019-02-23 10:46:07 +00:00
|
|
|
proto.RegisterType((*SignedHash)(nil), "piecestoreroutes.SignedHash")
|
2019-03-05 20:48:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() { proto.RegisterFile("piecestore.proto", fileDescriptor_569d535d76469daf) }
|
|
|
|
|
|
|
|
var fileDescriptor_569d535d76469daf = []byte{
|
2019-03-29 14:40:06 +00:00
|
|
|
// 548 bytes of a gzipped FileDescriptorProto
|
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0x41, 0x4f, 0xdb, 0x3e,
|
|
|
|
0x1c, 0x25, 0x4d, 0x5a, 0xc8, 0x8f, 0xb6, 0xe4, 0xef, 0x3f, 0x87, 0x80, 0xb6, 0xd1, 0xb1, 0x4b,
|
|
|
|
0xc4, 0xa4, 0xa2, 0x31, 0x69, 0xd2, 0x8e, 0x54, 0x20, 0x56, 0x4d, 0x43, 0x95, 0x69, 0x2f, 0xdb,
|
|
|
|
0x21, 0x73, 0xe3, 0xdf, 0x52, 0x8b, 0x10, 0x47, 0xb1, 0xa3, 0x15, 0xae, 0xfb, 0x72, 0xfb, 0x0c,
|
|
|
|
0x3b, 0xf0, 0x41, 0x76, 0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