You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
311 lines
11 KiB
311 lines
11 KiB
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: downloader.proto
|
|
|
|
package downloader
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
proto "github.com/golang/protobuf/proto"
|
|
grpc "google.golang.org/grpc"
|
|
math "math"
|
|
)
|
|
|
|
// 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.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
type DownloaderRequest_RequestType int32
|
|
|
|
const (
|
|
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: "NEWBLOCK",
|
|
3: "REGISTER",
|
|
4: "REGISTERTIMEOUT",
|
|
5: "UNKNOWN",
|
|
}
|
|
|
|
var DownloaderRequest_RequestType_value = map[string]int32{
|
|
"HEADER": 0,
|
|
"BLOCK": 1,
|
|
"NEWBLOCK": 2,
|
|
"REGISTER": 3,
|
|
"REGISTERTIMEOUT": 4,
|
|
"UNKNOWN": 5,
|
|
}
|
|
|
|
func (x DownloaderRequest_RequestType) String() string {
|
|
return proto.EnumName(DownloaderRequest_RequestType_name, int32(x))
|
|
}
|
|
|
|
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:"-"`
|
|
}
|
|
|
|
func (m *DownloaderRequest) Reset() { *m = DownloaderRequest{} }
|
|
func (m *DownloaderRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*DownloaderRequest) ProtoMessage() {}
|
|
func (*DownloaderRequest) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6a99ec95c7ab1ff1, []int{0}
|
|
}
|
|
|
|
func (m *DownloaderRequest) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DownloaderRequest.Unmarshal(m, b)
|
|
}
|
|
func (m *DownloaderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DownloaderRequest.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *DownloaderRequest) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DownloaderRequest.Merge(m, src)
|
|
}
|
|
func (m *DownloaderRequest) XXX_Size() int {
|
|
return xxx_messageInfo_DownloaderRequest.Size(m)
|
|
}
|
|
func (m *DownloaderRequest) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DownloaderRequest.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DownloaderRequest proto.InternalMessageInfo
|
|
|
|
func (m *DownloaderRequest) GetType() DownloaderRequest_RequestType {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return DownloaderRequest_HEADER
|
|
}
|
|
|
|
func (m *DownloaderRequest) GetHashes() [][]byte {
|
|
if m != nil {
|
|
return m.Hashes
|
|
}
|
|
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"`
|
|
// 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{} }
|
|
func (m *DownloaderResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*DownloaderResponse) ProtoMessage() {}
|
|
func (*DownloaderResponse) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_6a99ec95c7ab1ff1, []int{1}
|
|
}
|
|
|
|
func (m *DownloaderResponse) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_DownloaderResponse.Unmarshal(m, b)
|
|
}
|
|
func (m *DownloaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_DownloaderResponse.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *DownloaderResponse) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_DownloaderResponse.Merge(m, src)
|
|
}
|
|
func (m *DownloaderResponse) XXX_Size() int {
|
|
return xxx_messageInfo_DownloaderResponse.Size(m)
|
|
}
|
|
func (m *DownloaderResponse) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_DownloaderResponse.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_DownloaderResponse proto.InternalMessageInfo
|
|
|
|
func (m *DownloaderResponse) GetPayload() [][]byte {
|
|
if m != nil {
|
|
return m.Payload
|
|
}
|
|
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")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("downloader.proto", fileDescriptor_6a99ec95c7ab1ff1) }
|
|
|
|
var fileDescriptor_6a99ec95c7ab1ff1 = []byte{
|
|
// 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,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, 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.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// DownloaderClient is the client API for Downloader service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type DownloaderClient interface {
|
|
Query(ctx context.Context, in *DownloaderRequest, opts ...grpc.CallOption) (*DownloaderResponse, error)
|
|
}
|
|
|
|
type downloaderClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewDownloaderClient(cc *grpc.ClientConn) DownloaderClient {
|
|
return &downloaderClient{cc}
|
|
}
|
|
|
|
func (c *downloaderClient) Query(ctx context.Context, in *DownloaderRequest, opts ...grpc.CallOption) (*DownloaderResponse, error) {
|
|
out := new(DownloaderResponse)
|
|
err := c.cc.Invoke(ctx, "/downloader.Downloader/Query", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// DownloaderServer is the server API for Downloader service.
|
|
type DownloaderServer interface {
|
|
Query(context.Context, *DownloaderRequest) (*DownloaderResponse, error)
|
|
}
|
|
|
|
func RegisterDownloaderServer(s *grpc.Server, srv DownloaderServer) {
|
|
s.RegisterService(&_Downloader_serviceDesc, srv)
|
|
}
|
|
|
|
func _Downloader_Query_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DownloaderRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(DownloaderServer).Query(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/downloader.Downloader/Query",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(DownloaderServer).Query(ctx, req.(*DownloaderRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Downloader_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "downloader.Downloader",
|
|
HandlerType: (*DownloaderServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Query",
|
|
Handler: _Downloader_Query_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "downloader.proto",
|
|
}
|
|
|