@ -6,10 +6,9 @@ package downloader
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
@ -21,26 +20,35 @@ var _ = math.Inf
// 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.
const _ = proto . ProtoPackageIsVersion2 // please upgrade the proto package
const _ = proto . ProtoPackageIsVersion3 // please upgrade the proto package
type DownloaderRequest_RequestType int32
const (
DownloaderRequest_HEADER DownloaderRequest_RequestType = 0
DownloaderRequest_BLOCK DownloaderRequest_RequestType = 1
DownloaderRequest_UNKOWN DownloaderRequest_RequestType = 2
DownloaderRequest_HEADER DownloaderRequest_RequestType = 0
DownloaderRequest_BLOCK DownloaderRequest_RequestType = 1
DownloaderRequest_NEWBLOCK DownloaderRequest_RequestType = 2
DownloaderRequest_REGISTER DownloaderRequest_RequestType = 3
DownloaderRequest_REGISTERTIMEOUT DownloaderRequest_RequestType = 4
DownloaderRequest_UNKNOWN DownloaderRequest_RequestType = 5
)
var DownloaderRequest_RequestType_name = map [ int32 ] string {
0 : "HEADER" ,
1 : "BLOCK" ,
2 : "UNKOWN" ,
2 : "NEWBLOCK" ,
3 : "REGISTER" ,
4 : "REGISTERTIMEOUT" ,
5 : "UNKNOWN" ,
}
var DownloaderRequest_RequestType_value = map [ string ] int32 {
"HEADER" : 0 ,
"BLOCK" : 1 ,
"UNKOWN" : 2 ,
"HEADER" : 0 ,
"BLOCK" : 1 ,
"NEWBLOCK" : 2 ,
"REGISTER" : 3 ,
"REGISTERTIMEOUT" : 4 ,
"UNKNOWN" : 5 ,
}
func ( x DownloaderRequest_RequestType ) String ( ) string {
@ -51,12 +59,42 @@ func (DownloaderRequest_RequestType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_6a99ec95c7ab1ff1 , [ ] int { 0 , 0 }
}
type DownloaderResponse_RegisterResponseType int32
const (
DownloaderResponse_SUCCESS DownloaderResponse_RegisterResponseType = 0
DownloaderResponse_FAIL DownloaderResponse_RegisterResponseType = 1
DownloaderResponse_INSYNC DownloaderResponse_RegisterResponseType = 2
)
var DownloaderResponse_RegisterResponseType_name = map [ int32 ] string {
0 : "SUCCESS" ,
1 : "FAIL" ,
2 : "INSYNC" ,
}
var DownloaderResponse_RegisterResponseType_value = map [ string ] int32 {
"SUCCESS" : 0 ,
"FAIL" : 1 ,
"INSYNC" : 2 ,
}
func ( x DownloaderResponse_RegisterResponseType ) String ( ) string {
return proto . EnumName ( DownloaderResponse_RegisterResponseType_name , int32 ( x ) )
}
func ( DownloaderResponse_RegisterResponseType ) EnumDescriptor ( ) ( [ ] byte , [ ] int ) {
return fileDescriptor_6a99ec95c7ab1ff1 , [ ] int { 1 , 0 }
}
// DownloaderRequest is the generic download request.
type DownloaderRequest struct {
// Request type.
Type DownloaderRequest_RequestType ` protobuf:"varint,1,opt,name=type,proto3,enum=downloader.DownloaderRequest_RequestType" json:"type,omitempty" `
// The hashes of the blocks we want to download.
Hashes [ ] [ ] byte ` protobuf:"bytes,2,rep,name=hashes,proto3" json:"hashes,omitempty" `
PeerHash [ ] byte ` protobuf:"bytes,3,opt,name=peerHash,proto3" json:"peerHash,omitempty" `
BlockHash [ ] byte ` protobuf:"bytes,4,opt,name=blockHash,proto3" json:"blockHash,omitempty" `
XXX_NoUnkeyedLiteral struct { } ` json:"-" `
XXX_unrecognized [ ] byte ` json:"-" `
XXX_sizecache int32 ` json:"-" `
@ -101,13 +139,29 @@ func (m *DownloaderRequest) GetHashes() [][]byte {
return nil
}
func ( m * DownloaderRequest ) GetPeerHash ( ) [ ] byte {
if m != nil {
return m . PeerHash
}
return nil
}
func ( m * DownloaderRequest ) GetBlockHash ( ) [ ] byte {
if m != nil {
return m . BlockHash
}
return nil
}
// DownloaderResponse is the generic response of DownloaderRequest.
type DownloaderResponse struct {
// payload of Block.
Payload [ ] [ ] byte ` protobuf:"bytes,1,rep,name=payload,proto3" json:"payload,omitempty" `
XXX_NoUnkeyedLiteral struct { } ` json:"-" `
XXX_unrecognized [ ] byte ` json:"-" `
XXX_sizecache int32 ` json:"-" `
Payload [ ] [ ] byte ` protobuf:"bytes,1,rep,name=payload,proto3" json:"payload,omitempty" `
// response of registration request
Type DownloaderResponse_RegisterResponseType ` protobuf:"varint,2,opt,name=type,proto3,enum=downloader.DownloaderResponse_RegisterResponseType" json:"type,omitempty" `
XXX_NoUnkeyedLiteral struct { } ` json:"-" `
XXX_unrecognized [ ] byte ` json:"-" `
XXX_sizecache int32 ` json:"-" `
}
func ( m * DownloaderResponse ) Reset ( ) { * m = DownloaderResponse { } }
@ -142,8 +196,16 @@ func (m *DownloaderResponse) GetPayload() [][]byte {
return nil
}
func ( m * DownloaderResponse ) GetType ( ) DownloaderResponse_RegisterResponseType {
if m != nil {
return m . Type
}
return DownloaderResponse_SUCCESS
}
func init ( ) {
proto . RegisterEnum ( "downloader.DownloaderRequest_RequestType" , DownloaderRequest_RequestType_name , DownloaderRequest_RequestType_value )
proto . RegisterEnum ( "downloader.DownloaderResponse_RegisterResponseType" , DownloaderResponse_RegisterResponseType_name , DownloaderResponse_RegisterResponseType_value )
proto . RegisterType ( ( * DownloaderRequest ) ( nil ) , "downloader.DownloaderRequest" )
proto . RegisterType ( ( * DownloaderResponse ) ( nil ) , "downloader.DownloaderResponse" )
}
@ -151,21 +213,29 @@ func init() {
func init ( ) { proto . RegisterFile ( "downloader.proto" , fileDescriptor_6a99ec95c7ab1ff1 ) }
var fileDescriptor_6a99ec95c7ab1ff1 = [ ] byte {
// 210 bytes of a gzipped FileDescriptorProto
0x1f , 0x8b , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x02 , 0xff , 0xe2 , 0x12 , 0x48 , 0xc9 , 0x2f , 0xcf ,
0xcb , 0xc9 , 0x4f , 0x4c , 0x49 , 0x2d , 0xd2 , 0x2b , 0x28 , 0xca , 0x2f , 0xc9 , 0x17 , 0xe2 , 0x42 , 0x88 ,
0x28 , 0xcd , 0x61 , 0xe4 , 0x12 , 0x74 , 0x81 , 0x73 , 0x83 , 0x52 , 0x0b , 0x4b , 0x53 , 0x8b , 0x4b , 0x84 ,
0x6c , 0xb9 , 0x58 , 0x4a , 0x2a , 0x0b , 0x52 , 0x25 , 0x18 , 0x15 , 0x18 , 0x35 , 0xf8 , 0x8c , 0x34 , 0xf5 ,
0x90 , 0x8c , 0xc0 , 0x50 , 0xac , 0x07 , 0xa5 , 0x43 , 0x2a , 0x0b , 0x52 , 0x83 , 0xc0 , 0xda , 0x84 , 0xc4 ,
0xb8 , 0xd8 , 0x32 , 0x12 , 0x8b , 0x33 , 0x52 , 0x8b , 0x25 , 0x98 , 0x14 , 0x98 , 0x35 , 0x78 , 0x82 , 0xa0 ,
0x3c , 0x25 , 0x03 , 0x2e , 0x6e , 0x24 , 0xc5 , 0x42 , 0x5c , 0x5c , 0x6c , 0x1e , 0xae , 0x8e , 0x2e , 0xae ,
0x41 , 0x02 , 0x0c , 0x42 , 0x9c , 0x5c , 0xac , 0x4e , 0x3e , 0xfe , 0xce , 0xde , 0x02 , 0x8c , 0x20 , 0xe1 ,
0x50 , 0x3f , 0x6f , 0xff , 0x70 , 0x3f , 0x01 , 0x26 , 0x25 , 0x3d , 0x2e , 0x21 , 0x64 , 0x0b , 0x8b , 0x0b ,
0xf2 , 0xf3 , 0x8a , 0x53 , 0x85 , 0x24 , 0xb8 , 0xd8 , 0x0b , 0x12 , 0x2b , 0x41 , 0x82 , 0x12 , 0x8c , 0x60 ,
0x0b , 0x60 , 0x5c , 0xa3 , 0x30 , 0x2e , 0x2e , 0x84 , 0x7a , 0x21 , 0x0f , 0x2e , 0xd6 , 0xc0 , 0xd2 , 0xd4 ,
0xa2 , 0x4a , 0x21 , 0x59 , 0xbc , 0x3e , 0x90 , 0x92 , 0xc3 , 0x25 , 0x0d , 0xb1 , 0x4f , 0x89 , 0x21 , 0x89 ,
0x0d , 0x1c , 0x72 , 0xc6 , 0x80 , 0x00 , 0x00 , 0x00 , 0xff , 0xff , 0xab , 0xfd , 0xd9 , 0xfa , 0x4d , 0x01 ,
0x00 , 0x00 ,
// 337 bytes of a gzipped FileDescriptorProto
0x1f , 0x8b , 0x08 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x02 , 0xff , 0x7c , 0x92 , 0xcf , 0x4e , 0xc2 , 0x40 ,
0x10 , 0xc6 , 0xd9 , 0x52 , 0xfe , 0x0d , 0x44 , 0xd7 , 0xd1 , 0x98 , 0x86 , 0xa8 , 0x21 , 0x3d , 0xe1 , 0xa5 ,
0x07 , 0x38 , 0x79 , 0xf0 , 0x80 , 0x65 , 0x85 , 0x06 , 0x2c , 0x71 , 0x5b , 0x24 , 0x1e , 0x8b , 0x6c , 0xc4 ,
0x48 , 0x68 , 0xed , 0x96 , 0x98 , 0xbe , 0x81 , 0xcf , 0xe3 , 0x13 , 0x9a , 0x96 , 0x3f , 0x25 , 0x51 , 0x39 ,
0x35 , 0xbf , 0x6f , 0xba , 0x33 , 0xf3 , 0x7d , 0xbb , 0x40 , 0x67 , 0xfe , 0xe7 , 0x72 , 0xe1 , 0x7b , 0x33 ,
0x11 , 0x1a , 0x41 , 0xe8 , 0x47 , 0x3e , 0x42 , 0xa6 , 0xe8 , 0x5f , 0x0a , 0x9c , 0x74 , 0x77 , 0xc8 , 0xc5 ,
0xc7 , 0x4a , 0xc8 , 0x08 , 0x6f , 0x41 , 0x8d , 0xe2 , 0x40 , 0x68 , 0xa4 , 0x41 , 0x9a , 0x47 , 0xad , 0x6b ,
0x63 , 0xaf , 0xc5 , 0xaf , 0x9f , 0x8d , 0xcd , 0xd7 , 0x8d , 0x03 , 0xc1 , 0xd3 , 0x63 , 0x78 , 0x0e , 0xc5 ,
0xb9 , 0x27 , 0xe7 , 0x42 , 0x6a , 0x4a , 0x23 , 0xdf , 0xac , 0xf1 , 0x0d , 0x61 , 0x1d , 0xca , 0x81 , 0x10 ,
0x61 , 0xdf , 0x93 , 0x73 , 0x2d , 0xdf , 0x20 , 0xcd , 0x1a , 0xdf , 0x31 , 0x5e , 0x40 , 0x65 , 0xba , 0xf0 ,
0x5f , 0xde , 0xd3 , 0xa2 , 0x9a , 0x16 , 0x33 , 0x41 , 0x9f , 0x42 , 0x75 , 0x6f , 0x0c , 0x02 , 0x14 , 0xfb ,
0xac , 0xd3 , 0x65 , 0x9c , 0xe6 , 0xb0 , 0x02 , 0x85 , 0xbb , 0xe1 , 0xc8 , 0x1c , 0x50 , 0x82 , 0x35 , 0x28 ,
0xdb , 0x6c , 0xb2 , 0x26 , 0x25 , 0x21 , 0xce , 0x7a , 0x96 , 0xe3 , 0x32 , 0x4e , 0xf3 , 0x78 , 0x0a , 0xc7 ,
0x5b , 0x72 , 0xad , 0x07 , 0x36 , 0x1a , 0xbb , 0x54 , 0xc5 , 0x2a , 0x94 , 0xc6 , 0xf6 , 0xc0 , 0x1e , 0x4d ,
0x6c , 0x5a , 0xd0 , 0xbf , 0x09 , 0xe0 , 0xbe , 0x3b , 0x19 , 0xf8 , 0x4b , 0x29 , 0x50 , 0x83 , 0x52 , 0xe0 ,
0xc5 , 0x89 , 0xa8 , 0x91 , 0xd4 , 0xcd , 0x16 , 0xb1 , 0xb7 , 0x49 , 0x49 , 0x49 , 0x53 , 0x6a , 0xff , 0x97 ,
0xd2 , 0xba , 0x8f , 0xc1 , 0xc5 , 0xeb , 0x9b , 0x8c , 0x32 , 0x21 , 0xcb , 0x4b , 0xbf , 0x81 , 0xb3 , 0xbf ,
0xaa , 0xc9 , 0x7a , 0xce , 0xd8 , 0x34 , 0x99 , 0xe3 , 0xd0 , 0x1c , 0x96 , 0x41 , 0xbd , 0xef , 0x58 , 0x43 ,
0x4a , 0x12 , 0xf7 , 0x96 , 0xed , 0x3c , 0xdb , 0x26 , 0x55 , 0x5a , 0x4f , 0x00 , 0xd9 , 0x2c , 0xec , 0x43 ,
0xe1 , 0x71 , 0x25 , 0xc2 , 0x18 , 0x2f , 0x0f , 0x5e , 0x59 , 0xfd , 0xea , 0xf0 , 0xae , 0x7a , 0x6e , 0x5a ,
0x4c , 0x9f , 0x4a , 0xfb , 0x27 , 0x00 , 0x00 , 0xff , 0xff , 0xf9 , 0xfb , 0x70 , 0x9d , 0x3e , 0x02 , 0x00 ,
0x00 ,
}
// Reference imports to suppress errors if they are not otherwise used.