downloader

package
v0.0.0-...-3a5d5d8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: LGPL-3.0 Imports: 8 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",
		8: "BLOCKBYHEIGHT",
	}
	DownloaderRequest_RequestType_value = map[string]int32{
		"BLOCKHASH":       0,
		"BLOCK":           1,
		"NEWBLOCK":        2,
		"BLOCKHEIGHT":     3,
		"REGISTER":        4,
		"REGISTERTIMEOUT": 5,
		"UNKNOWN":         6,
		"BLOCKHEADER":     7,
		"BLOCKBYHEIGHT":   8,
	}
)

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 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",
}

Downloader_ServiceDesc is the grpc.ServiceDesc for Downloader service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_downloader_proto protoreflect.FileDescriptor

Functions

func RegisterDownloaderServer

func RegisterDownloaderServer(s grpc.ServiceRegistrar, 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://pkg.go.dev/google.golang.org/grpc/?tab=doc#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"`
	RegisterWithSig  bool     `protobuf:"varint,8,opt,name=registerWithSig,proto3" json:"registerWithSig,omitempty"`   // Expect to have NEWBLOCK response of block along with current signature
	GetBlocksWithSig bool     `protobuf:"varint,9,opt,name=getBlocksWithSig,proto3" json:"getBlocksWithSig,omitempty"` // Have block along with signature for BLOCK request.
	Heights          []uint64 `protobuf:"varint,10,rep,packed,name=heights,proto3" json:"heights,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) GetGetBlocksWithSig

func (x *DownloaderRequest) GetGetBlocksWithSig() bool

func (*DownloaderRequest) GetHashes

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

func (*DownloaderRequest) GetHeights

func (x *DownloaderRequest) GetHeights() []uint64

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

func (x *DownloaderRequest) GetRegisterWithSig() bool

func (*DownloaderRequest) GetSize

func (x *DownloaderRequest) GetSize() uint32

func (*DownloaderRequest) GetType

func (*DownloaderRequest) ProtoMessage

func (*DownloaderRequest) ProtoMessage()

func (*DownloaderRequest) ProtoReflect

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
	DownloaderRequest_BLOCKBYHEIGHT   DownloaderRequest_RequestType = 8
)

func (DownloaderRequest_RequestType) Descriptor

func (DownloaderRequest_RequestType) Enum

func (DownloaderRequest_RequestType) EnumDescriptor deprecated

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

Deprecated: Use DownloaderRequest_RequestType.Descriptor instead.

func (DownloaderRequest_RequestType) Number

func (DownloaderRequest_RequestType) String

func (DownloaderRequest_RequestType) Type

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

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

func (DownloaderResponse_RegisterResponseType) Enum

func (DownloaderResponse_RegisterResponseType) EnumDescriptor deprecated

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

Deprecated: Use DownloaderResponse_RegisterResponseType.Descriptor instead.

func (DownloaderResponse_RegisterResponseType) Number

func (DownloaderResponse_RegisterResponseType) String

func (DownloaderResponse_RegisterResponseType) Type

type DownloaderServer

type DownloaderServer interface {
	Query(context.Context, *DownloaderRequest) (*DownloaderResponse, error)
	// contains filtered or unexported methods
}

DownloaderServer is the server API for Downloader service. All implementations must embed UnimplementedDownloaderServer for forward compatibility

type UnimplementedDownloaderServer

type UnimplementedDownloaderServer struct {
}

UnimplementedDownloaderServer must be embedded to have forward compatible implementations.

func (UnimplementedDownloaderServer) Query

type UnsafeDownloaderServer

type UnsafeDownloaderServer interface {
	// contains filtered or unexported methods
}

UnsafeDownloaderServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DownloaderServer will result in compilation errors.

Jump to

Keyboard shortcuts

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