downloader

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 9 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",
	}
	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.

View Source
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.

View Source
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 (*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) Enum added in v1.10.0

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 (DownloaderRequest_RequestType) String

func (DownloaderRequest_RequestType) Type added in v1.10.0

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 (*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) Enum added in v1.10.0

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 (DownloaderResponse_RegisterResponseType) String

func (DownloaderResponse_RegisterResponseType) Type added in v1.10.0

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