Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterDownloaderServer(s grpc.ServiceRegistrar, srv DownloaderServer)
- type DownloadItem
- func (*DownloadItem) Descriptor() ([]byte, []int)deprecated
- func (x *DownloadItem) GetPath() string
- func (x *DownloadItem) GetTorrentHash() *types.H160
- func (*DownloadItem) ProtoMessage()
- func (x *DownloadItem) ProtoReflect() protoreflect.Message
- func (x *DownloadItem) Reset()
- func (x *DownloadItem) String() string
- type DownloadRequest
- type DownloaderClient
- type DownloaderServer
- type StatsReply
- func (*StatsReply) Descriptor() ([]byte, []int)deprecated
- func (x *StatsReply) GetBytesCompleted() uint64
- func (x *StatsReply) GetBytesTotal() uint64
- func (x *StatsReply) GetCompleted() bool
- func (x *StatsReply) GetConnectionsTotal() uint64
- func (x *StatsReply) GetDownloadRate() uint64
- func (x *StatsReply) GetFilesTotal() int32
- func (x *StatsReply) GetMetadataReady() int32
- func (x *StatsReply) GetPeersUnique() int32
- func (x *StatsReply) GetProgress() float32
- func (x *StatsReply) GetUploadRate() uint64
- func (*StatsReply) ProtoMessage()
- func (x *StatsReply) ProtoReflect() protoreflect.Message
- func (x *StatsReply) Reset()
- func (x *StatsReply) String() string
- type StatsRequest
- type UnimplementedDownloaderServer
- func (UnimplementedDownloaderServer) Download(context.Context, *DownloadRequest) (*emptypb.Empty, error)
- func (UnimplementedDownloaderServer) Stats(context.Context, *StatsRequest) (*StatsReply, error)
- func (UnimplementedDownloaderServer) Verify(context.Context, *VerifyRequest) (*emptypb.Empty, error)
- type UnsafeDownloaderServer
- type VerifyRequest
Constants ¶
const ( Downloader_Download_FullMethodName = "/downloader.Downloader/Download" Downloader_Verify_FullMethodName = "/downloader.Downloader/Verify" Downloader_Stats_FullMethodName = "/downloader.Downloader/Stats" )
Variables ¶
var Downloader_ServiceDesc = grpc.ServiceDesc{ ServiceName: "downloader.Downloader", HandlerType: (*DownloaderServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Download", Handler: _Downloader_Download_Handler, }, { MethodName: "Verify", Handler: _Downloader_Verify_Handler, }, { MethodName: "Stats", Handler: _Downloader_Stats_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "downloader/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)
var File_downloader_downloader_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDownloaderServer ¶
func RegisterDownloaderServer(s grpc.ServiceRegistrar, srv DownloaderServer)
Types ¶
type DownloadItem ¶
type DownloadItem struct { Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` TorrentHash *types.H160 `protobuf:"bytes,2,opt,name=torrent_hash,json=torrentHash,proto3" json:"torrent_hash,omitempty"` // will be resolved as magnet link // contains filtered or unexported fields }
DownloadItem: - if Erigon created new snapshot and want seed it - if Erigon wnat download files - it fills only "torrent_hash" field
func (*DownloadItem) Descriptor
deprecated
func (*DownloadItem) Descriptor() ([]byte, []int)
Deprecated: Use DownloadItem.ProtoReflect.Descriptor instead.
func (*DownloadItem) GetPath ¶
func (x *DownloadItem) GetPath() string
func (*DownloadItem) GetTorrentHash ¶
func (x *DownloadItem) GetTorrentHash() *types.H160
func (*DownloadItem) ProtoMessage ¶
func (*DownloadItem) ProtoMessage()
func (*DownloadItem) ProtoReflect ¶
func (x *DownloadItem) ProtoReflect() protoreflect.Message
func (*DownloadItem) Reset ¶
func (x *DownloadItem) Reset()
func (*DownloadItem) String ¶
func (x *DownloadItem) String() string
type DownloadRequest ¶
type DownloadRequest struct { Items []*DownloadItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // single hash will be resolved as magnet link // contains filtered or unexported fields }
func (*DownloadRequest) Descriptor
deprecated
func (*DownloadRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownloadRequest.ProtoReflect.Descriptor instead.
func (*DownloadRequest) GetItems ¶
func (x *DownloadRequest) GetItems() []*DownloadItem
func (*DownloadRequest) ProtoMessage ¶
func (*DownloadRequest) ProtoMessage()
func (*DownloadRequest) ProtoReflect ¶
func (x *DownloadRequest) ProtoReflect() protoreflect.Message
func (*DownloadRequest) Reset ¶
func (x *DownloadRequest) Reset()
func (*DownloadRequest) String ¶
func (x *DownloadRequest) String() string
type DownloaderClient ¶
type DownloaderClient interface { Download(ctx context.Context, in *DownloadRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Verify(ctx context.Context, in *VerifyRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) Stats(ctx context.Context, in *StatsRequest, opts ...grpc.CallOption) (*StatsReply, 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 DownloaderServer ¶
type DownloaderServer interface { Download(context.Context, *DownloadRequest) (*emptypb.Empty, error) Verify(context.Context, *VerifyRequest) (*emptypb.Empty, error) Stats(context.Context, *StatsRequest) (*StatsReply, error) // contains filtered or unexported methods }
DownloaderServer is the server API for Downloader service. All implementations must embed UnimplementedDownloaderServer for forward compatibility
type StatsReply ¶
type StatsReply struct { // First step on startup - "resolve metadata": // - understand total amount of data to download // - ensure all pieces hashes available // - validate files after crush // - when all metadata ready - can start download/upload MetadataReady int32 `protobuf:"varint,1,opt,name=metadata_ready,json=metadataReady,proto3" json:"metadata_ready,omitempty"` FilesTotal int32 `protobuf:"varint,2,opt,name=files_total,json=filesTotal,proto3" json:"files_total,omitempty"` PeersUnique int32 `protobuf:"varint,4,opt,name=peers_unique,json=peersUnique,proto3" json:"peers_unique,omitempty"` ConnectionsTotal uint64 `protobuf:"varint,5,opt,name=connections_total,json=connectionsTotal,proto3" json:"connections_total,omitempty"` Completed bool `protobuf:"varint,6,opt,name=completed,proto3" json:"completed,omitempty"` Progress float32 `protobuf:"fixed32,7,opt,name=progress,proto3" json:"progress,omitempty"` BytesCompleted uint64 `protobuf:"varint,8,opt,name=bytes_completed,json=bytesCompleted,proto3" json:"bytes_completed,omitempty"` BytesTotal uint64 `protobuf:"varint,9,opt,name=bytes_total,json=bytesTotal,proto3" json:"bytes_total,omitempty"` UploadRate uint64 `protobuf:"varint,10,opt,name=upload_rate,json=uploadRate,proto3" json:"upload_rate,omitempty"` // bytes/sec DownloadRate uint64 `protobuf:"varint,11,opt,name=download_rate,json=downloadRate,proto3" json:"download_rate,omitempty"` // bytes/sec // contains filtered or unexported fields }
func (*StatsReply) Descriptor
deprecated
func (*StatsReply) Descriptor() ([]byte, []int)
Deprecated: Use StatsReply.ProtoReflect.Descriptor instead.
func (*StatsReply) GetBytesCompleted ¶
func (x *StatsReply) GetBytesCompleted() uint64
func (*StatsReply) GetBytesTotal ¶
func (x *StatsReply) GetBytesTotal() uint64
func (*StatsReply) GetCompleted ¶
func (x *StatsReply) GetCompleted() bool
func (*StatsReply) GetConnectionsTotal ¶
func (x *StatsReply) GetConnectionsTotal() uint64
func (*StatsReply) GetDownloadRate ¶
func (x *StatsReply) GetDownloadRate() uint64
func (*StatsReply) GetFilesTotal ¶
func (x *StatsReply) GetFilesTotal() int32
func (*StatsReply) GetMetadataReady ¶
func (x *StatsReply) GetMetadataReady() int32
func (*StatsReply) GetPeersUnique ¶
func (x *StatsReply) GetPeersUnique() int32
func (*StatsReply) GetProgress ¶
func (x *StatsReply) GetProgress() float32
func (*StatsReply) GetUploadRate ¶
func (x *StatsReply) GetUploadRate() uint64
func (*StatsReply) ProtoMessage ¶
func (*StatsReply) ProtoMessage()
func (*StatsReply) ProtoReflect ¶
func (x *StatsReply) ProtoReflect() protoreflect.Message
func (*StatsReply) Reset ¶
func (x *StatsReply) Reset()
func (*StatsReply) String ¶
func (x *StatsReply) String() string
type StatsRequest ¶
type StatsRequest struct {
// contains filtered or unexported fields
}
func (*StatsRequest) Descriptor
deprecated
func (*StatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatsRequest.ProtoReflect.Descriptor instead.
func (*StatsRequest) ProtoMessage ¶
func (*StatsRequest) ProtoMessage()
func (*StatsRequest) ProtoReflect ¶
func (x *StatsRequest) ProtoReflect() protoreflect.Message
func (*StatsRequest) Reset ¶
func (x *StatsRequest) Reset()
func (*StatsRequest) String ¶
func (x *StatsRequest) String() string
type UnimplementedDownloaderServer ¶
type UnimplementedDownloaderServer struct { }
UnimplementedDownloaderServer must be embedded to have forward compatible implementations.
func (UnimplementedDownloaderServer) Download ¶
func (UnimplementedDownloaderServer) Download(context.Context, *DownloadRequest) (*emptypb.Empty, error)
func (UnimplementedDownloaderServer) Stats ¶
func (UnimplementedDownloaderServer) Stats(context.Context, *StatsRequest) (*StatsReply, error)
func (UnimplementedDownloaderServer) Verify ¶
func (UnimplementedDownloaderServer) Verify(context.Context, *VerifyRequest) (*emptypb.Empty, error)
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.
type VerifyRequest ¶
type VerifyRequest struct {
// contains filtered or unexported fields
}
func (*VerifyRequest) Descriptor
deprecated
func (*VerifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead.
func (*VerifyRequest) ProtoMessage ¶
func (*VerifyRequest) ProtoMessage()
func (*VerifyRequest) ProtoReflect ¶
func (x *VerifyRequest) ProtoReflect() protoreflect.Message
func (*VerifyRequest) Reset ¶
func (x *VerifyRequest) Reset()
func (*VerifyRequest) String ¶
func (x *VerifyRequest) String() string