Documentation ¶
Index ¶
- Variables
- func RegisterDownloaderServer(s *grpc.Server, srv DownloaderServer)
- type DownloaderClient
- type DownloaderRequest
- func (*DownloaderRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DownloaderRequest) GetBlockHash() []byte
- func (x *DownloaderRequest) GetHashes() [][]byte
- func (x *DownloaderRequest) GetIp() string
- func (x *DownloaderRequest) GetPeerHash() []byte
- func (x *DownloaderRequest) GetPort() string
- func (x *DownloaderRequest) GetSize() uint32
- func (x *DownloaderRequest) GetType() DownloaderRequest_RequestType
- func (*DownloaderRequest) ProtoMessage()
- func (x *DownloaderRequest) ProtoReflect() protoreflect.Message
- func (x *DownloaderRequest) Reset()
- func (x *DownloaderRequest) String() string
- type DownloaderRequest_RequestType
- func (DownloaderRequest_RequestType) Descriptor() protoreflect.EnumDescriptor
- func (x DownloaderRequest_RequestType) Enum() *DownloaderRequest_RequestType
- func (DownloaderRequest_RequestType) EnumDescriptor() ([]byte, []int)deprecated
- func (x DownloaderRequest_RequestType) Number() protoreflect.EnumNumber
- func (x DownloaderRequest_RequestType) String() string
- func (DownloaderRequest_RequestType) Type() protoreflect.EnumType
- type DownloaderResponse
- func (*DownloaderResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DownloaderResponse) GetBlockHeight() uint64
- func (x *DownloaderResponse) GetPayload() [][]byte
- func (x *DownloaderResponse) GetType() DownloaderResponse_RegisterResponseType
- func (*DownloaderResponse) ProtoMessage()
- func (x *DownloaderResponse) ProtoReflect() protoreflect.Message
- func (x *DownloaderResponse) Reset()
- func (x *DownloaderResponse) String() string
- type DownloaderResponse_RegisterResponseType
- func (DownloaderResponse_RegisterResponseType) Descriptor() protoreflect.EnumDescriptor
- func (x DownloaderResponse_RegisterResponseType) Enum() *DownloaderResponse_RegisterResponseType
- func (DownloaderResponse_RegisterResponseType) EnumDescriptor() ([]byte, []int)deprecated
- func (x DownloaderResponse_RegisterResponseType) Number() protoreflect.EnumNumber
- func (x DownloaderResponse_RegisterResponseType) String() string
- func (DownloaderResponse_RegisterResponseType) Type() protoreflect.EnumType
- type DownloaderServer
- type UnimplementedDownloaderServer
Constants ¶
This section is empty.
Variables ¶
var ( DownloaderRequest_RequestType_name = map[int32]string{ 0: "BLOCKHASH", 1: "BLOCK", 2: "NEWBLOCK", 3: "BLOCKHEIGHT", 4: "REGISTER", 5: "REGISTERTIMEOUT", 6: "UNKNOWN", 7: "BLOCKHEADER", } DownloaderRequest_RequestType_value = map[string]int32{ "BLOCKHASH": 0, "BLOCK": 1, "NEWBLOCK": 2, "BLOCKHEIGHT": 3, "REGISTER": 4, "REGISTERTIMEOUT": 5, "UNKNOWN": 6, "BLOCKHEADER": 7, } )
Enum value maps for DownloaderRequest_RequestType.
var ( DownloaderResponse_RegisterResponseType_name = map[int32]string{ 0: "SUCCESS", 1: "FAIL", 2: "INSYNC", } DownloaderResponse_RegisterResponseType_value = map[string]int32{ "SUCCESS": 0, "FAIL": 1, "INSYNC": 2, } )
Enum value maps for DownloaderResponse_RegisterResponseType.
var File_downloader_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDownloaderServer ¶
func RegisterDownloaderServer(s *grpc.Server, srv DownloaderServer)
Types ¶
type DownloaderClient ¶
type DownloaderClient interface {
Query(ctx context.Context, in *DownloaderRequest, opts ...grpc.CallOption) (*DownloaderResponse, error)
}
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.
func NewDownloaderClient ¶
func NewDownloaderClient(cc grpc.ClientConnInterface) DownloaderClient
type DownloaderRequest ¶
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"` // contains filtered or unexported fields }
DownloaderRequest is the generic download request.
func (*DownloaderRequest) Descriptor
deprecated
func (*DownloaderRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloaderRequest.ProtoReflect.Descriptor instead.
func (*DownloaderRequest) GetBlockHash ¶
func (x *DownloaderRequest) GetBlockHash() []byte
func (*DownloaderRequest) GetHashes ¶
func (x *DownloaderRequest) GetHashes() [][]byte
func (*DownloaderRequest) GetIp ¶
func (x *DownloaderRequest) GetIp() string
func (*DownloaderRequest) GetPeerHash ¶
func (x *DownloaderRequest) GetPeerHash() []byte
func (*DownloaderRequest) GetPort ¶
func (x *DownloaderRequest) GetPort() string
func (*DownloaderRequest) GetSize ¶
func (x *DownloaderRequest) GetSize() uint32
func (*DownloaderRequest) GetType ¶
func (x *DownloaderRequest) GetType() DownloaderRequest_RequestType
func (*DownloaderRequest) ProtoMessage ¶
func (*DownloaderRequest) ProtoMessage()
func (*DownloaderRequest) ProtoReflect ¶ added in v1.10.0
func (x *DownloaderRequest) ProtoReflect() protoreflect.Message
func (*DownloaderRequest) Reset ¶
func (x *DownloaderRequest) Reset()
func (*DownloaderRequest) String ¶
func (x *DownloaderRequest) String() string
type DownloaderRequest_RequestType ¶
type DownloaderRequest_RequestType int32
const ( DownloaderRequest_BLOCKHASH 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 DownloaderRequest_BLOCKHEADER DownloaderRequest_RequestType = 7 )
func (DownloaderRequest_RequestType) Descriptor ¶ added in v1.10.0
func (DownloaderRequest_RequestType) Descriptor() protoreflect.EnumDescriptor
func (DownloaderRequest_RequestType) Enum ¶ added in v1.10.0
func (x DownloaderRequest_RequestType) Enum() *DownloaderRequest_RequestType
func (DownloaderRequest_RequestType) EnumDescriptor
deprecated
func (DownloaderRequest_RequestType) EnumDescriptor() ([]byte, []int)
Deprecated: Use DownloaderRequest_RequestType.Descriptor instead.
func (DownloaderRequest_RequestType) Number ¶ added in v1.10.0
func (x DownloaderRequest_RequestType) Number() protoreflect.EnumNumber
func (DownloaderRequest_RequestType) String ¶
func (x DownloaderRequest_RequestType) String() string
func (DownloaderRequest_RequestType) Type ¶ added in v1.10.0
func (DownloaderRequest_RequestType) Type() protoreflect.EnumType
type DownloaderResponse ¶
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"` // contains filtered or unexported fields }
DownloaderResponse is the generic response of DownloaderRequest.
func (*DownloaderResponse) Descriptor
deprecated
func (*DownloaderResponse) Descriptor() ([]byte, []int)
Deprecated: Use DownloaderResponse.ProtoReflect.Descriptor instead.
func (*DownloaderResponse) GetBlockHeight ¶
func (x *DownloaderResponse) GetBlockHeight() uint64
func (*DownloaderResponse) GetPayload ¶
func (x *DownloaderResponse) GetPayload() [][]byte
func (*DownloaderResponse) GetType ¶
func (x *DownloaderResponse) GetType() DownloaderResponse_RegisterResponseType
func (*DownloaderResponse) ProtoMessage ¶
func (*DownloaderResponse) ProtoMessage()
func (*DownloaderResponse) ProtoReflect ¶ added in v1.10.0
func (x *DownloaderResponse) ProtoReflect() protoreflect.Message
func (*DownloaderResponse) Reset ¶
func (x *DownloaderResponse) Reset()
func (*DownloaderResponse) String ¶
func (x *DownloaderResponse) String() string
type DownloaderResponse_RegisterResponseType ¶
type DownloaderResponse_RegisterResponseType int32
const ( DownloaderResponse_SUCCESS DownloaderResponse_RegisterResponseType = 0 DownloaderResponse_FAIL DownloaderResponse_RegisterResponseType = 1 DownloaderResponse_INSYNC DownloaderResponse_RegisterResponseType = 2 // node is now in sync, remove it from the broadcast list )
func (DownloaderResponse_RegisterResponseType) Descriptor ¶ added in v1.10.0
func (DownloaderResponse_RegisterResponseType) Descriptor() protoreflect.EnumDescriptor
func (DownloaderResponse_RegisterResponseType) EnumDescriptor
deprecated
func (DownloaderResponse_RegisterResponseType) EnumDescriptor() ([]byte, []int)
Deprecated: Use DownloaderResponse_RegisterResponseType.Descriptor instead.
func (DownloaderResponse_RegisterResponseType) Number ¶ added in v1.10.0
func (x DownloaderResponse_RegisterResponseType) Number() protoreflect.EnumNumber
func (DownloaderResponse_RegisterResponseType) String ¶
func (x DownloaderResponse_RegisterResponseType) String() string
func (DownloaderResponse_RegisterResponseType) Type ¶ added in v1.10.0
func (DownloaderResponse_RegisterResponseType) Type() protoreflect.EnumType
type DownloaderServer ¶
type DownloaderServer interface {
Query(context.Context, *DownloaderRequest) (*DownloaderResponse, error)
}
DownloaderServer is the server API for Downloader service.
type UnimplementedDownloaderServer ¶ added in v1.1.1
type UnimplementedDownloaderServer struct { }
UnimplementedDownloaderServer can be embedded to have forward compatible implementations.
func (*UnimplementedDownloaderServer) Query ¶ added in v1.1.1
func (*UnimplementedDownloaderServer) Query(context.Context, *DownloaderRequest) (*DownloaderResponse, error)