downloader

package
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DownloaderRequest_RequestType_name = map[int32]string{
	0: "BLOCKHASH",
	1: "BLOCK",
	2: "NEWBLOCK",
	3: "BLOCKHEIGHT",
	4: "REGISTER",
	5: "REGISTERTIMEOUT",
	6: "UNKNOWN",
	7: "BLOCKHEADER",
}
View Source
var DownloaderRequest_RequestType_value = map[string]int32{
	"BLOCKHASH":       0,
	"BLOCK":           1,
	"NEWBLOCK":        2,
	"BLOCKHEIGHT":     3,
	"REGISTER":        4,
	"REGISTERTIMEOUT": 5,
	"UNKNOWN":         6,
	"BLOCKHEADER":     7,
}
View Source
var DownloaderResponse_RegisterResponseType_name = map[int32]string{
	0: "SUCCESS",
	1: "FAIL",
	2: "INSYNC",
}
View Source
var DownloaderResponse_RegisterResponseType_value = map[string]int32{
	"SUCCESS": 0,
	"FAIL":    1,
	"INSYNC":  2,
}

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.ClientConn) 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

DownloaderRequest is the generic download request.

func (*DownloaderRequest) Descriptor

func (*DownloaderRequest) Descriptor() ([]byte, []int)

func (*DownloaderRequest) GetBlockHash

func (m *DownloaderRequest) GetBlockHash() []byte

func (*DownloaderRequest) GetHashes

func (m *DownloaderRequest) GetHashes() [][]byte

func (*DownloaderRequest) GetIp

func (m *DownloaderRequest) GetIp() string

func (*DownloaderRequest) GetPeerHash

func (m *DownloaderRequest) GetPeerHash() []byte

func (*DownloaderRequest) GetPort

func (m *DownloaderRequest) GetPort() string

func (*DownloaderRequest) GetSize

func (m *DownloaderRequest) GetSize() uint32

func (*DownloaderRequest) GetType

func (*DownloaderRequest) ProtoMessage

func (*DownloaderRequest) ProtoMessage()

func (*DownloaderRequest) Reset

func (m *DownloaderRequest) Reset()

func (*DownloaderRequest) String

func (m *DownloaderRequest) String() string

func (*DownloaderRequest) XXX_DiscardUnknown

func (m *DownloaderRequest) XXX_DiscardUnknown()

func (*DownloaderRequest) XXX_Marshal

func (m *DownloaderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DownloaderRequest) XXX_Merge

func (m *DownloaderRequest) XXX_Merge(src proto.Message)

func (*DownloaderRequest) XXX_Size

func (m *DownloaderRequest) XXX_Size() int

func (*DownloaderRequest) XXX_Unmarshal

func (m *DownloaderRequest) XXX_Unmarshal(b []byte) error

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) EnumDescriptor

func (DownloaderRequest_RequestType) EnumDescriptor() ([]byte, []int)

func (DownloaderRequest_RequestType) String

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"`
	XXX_NoUnkeyedLiteral struct{}                                `json:"-"`
	XXX_unrecognized     []byte                                  `json:"-"`
	XXX_sizecache        int32                                   `json:"-"`
}

DownloaderResponse is the generic response of DownloaderRequest.

func (*DownloaderResponse) Descriptor

func (*DownloaderResponse) Descriptor() ([]byte, []int)

func (*DownloaderResponse) GetBlockHeight

func (m *DownloaderResponse) GetBlockHeight() uint64

func (*DownloaderResponse) GetPayload

func (m *DownloaderResponse) GetPayload() [][]byte

func (*DownloaderResponse) GetType

func (*DownloaderResponse) ProtoMessage

func (*DownloaderResponse) ProtoMessage()

func (*DownloaderResponse) Reset

func (m *DownloaderResponse) Reset()

func (*DownloaderResponse) String

func (m *DownloaderResponse) String() string

func (*DownloaderResponse) XXX_DiscardUnknown

func (m *DownloaderResponse) XXX_DiscardUnknown()

func (*DownloaderResponse) XXX_Marshal

func (m *DownloaderResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DownloaderResponse) XXX_Merge

func (m *DownloaderResponse) XXX_Merge(src proto.Message)

func (*DownloaderResponse) XXX_Size

func (m *DownloaderResponse) XXX_Size() int

func (*DownloaderResponse) XXX_Unmarshal

func (m *DownloaderResponse) XXX_Unmarshal(b []byte) error

type DownloaderResponse_RegisterResponseType

type DownloaderResponse_RegisterResponseType int32
const (
	DownloaderResponse_SUCCESS DownloaderResponse_RegisterResponseType = 0
	DownloaderResponse_FAIL    DownloaderResponse_RegisterResponseType = 1
	DownloaderResponse_INSYNC  DownloaderResponse_RegisterResponseType = 2
)

func (DownloaderResponse_RegisterResponseType) EnumDescriptor

func (DownloaderResponse_RegisterResponseType) EnumDescriptor() ([]byte, []int)

func (DownloaderResponse_RegisterResponseType) String

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL