The core protocol of WoopChain
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.
 
 
 
woop/api/service/syncing/downloader/proto/downloader.pb.go

349 lines
13 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_BLOCKHEIGHT DownloaderRequest_RequestType = 3
DownloaderRequest_REGISTER DownloaderRequest_RequestType = 4
DownloaderRequest_REGISTERTIMEOUT DownloaderRequest_RequestType = 5
DownloaderRequest_UNKNOWN DownloaderRequest_RequestType = 6
)
var DownloaderRequest_RequestType_name = map[int32]string{
0: "HEADER",
1: "BLOCK",
2: "NEWBLOCK",
3: "BLOCKHEIGHT",
4: "REGISTER",
5: "REGISTERTIMEOUT",
6: "UNKNOWN",
}
var DownloaderRequest_RequestType_value = map[string]int32{
"HEADER": 0,
"BLOCK": 1,
"NEWBLOCK": 2,
"BLOCKHEIGHT": 3,
"REGISTER": 4,
"REGISTERTIMEOUT": 5,
"UNKNOWN": 6,
}
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"`
Ip string `protobuf:"bytes,5,opt,name=ip,proto3" json:"ip,omitempty"`
Port string `protobuf:"bytes,6,opt,name=port,proto3" json:"port,omitempty"`
Size uint32 `protobuf:"varint,7,opt,name=size,proto3" json:"size,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
}
func (m *DownloaderRequest) GetIp() string {
if m != nil {
return m.Ip
}
return ""
}
func (m *DownloaderRequest) GetPort() string {
if m != nil {
return m.Port
}
return ""
}
func (m *DownloaderRequest) GetSize() uint32 {
if m != nil {
return m.Size
}
return 0
}
// 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"`
BlockHeight uint64 `protobuf:"varint,3,opt,name=blockHeight,proto3" json:"blockHeight,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 (m *DownloaderResponse) GetBlockHeight() uint64 {
if m != nil {
return m.BlockHeight
}
return 0
}
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{
// 399 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x6e, 0xd3, 0x40,
0x10, 0x86, 0xb3, 0x8e, 0xe3, 0x24, 0x93, 0xd0,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, 0xc1, 0xb5, 0x25, 0xa9, 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",
}