Documentation ¶
Index ¶
- Variables
- func RegisterDaemonServer(s grpc.ServiceRegistrar, srv DaemonServer)
- type DaemonClient
- type DaemonServer
- type Daemon_DownloadClient
- type Daemon_DownloadServer
- type DownRequest
- func (*DownRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DownRequest) GetCallsystem() string
- func (x *DownRequest) GetDisableBackSource() bool
- func (x *DownRequest) GetGid() int64
- func (x *DownRequest) GetLimit() float64
- func (x *DownRequest) GetOutput() string
- func (x *DownRequest) GetPattern() string
- func (x *DownRequest) GetTimeout() int64
- func (x *DownRequest) GetUid() int64
- func (x *DownRequest) GetUrl() string
- func (x *DownRequest) GetUrlMeta() *base.UrlMeta
- func (x *DownRequest) GetUuid() string
- func (*DownRequest) ProtoMessage()
- func (x *DownRequest) ProtoReflect() protoreflect.Message
- func (x *DownRequest) Reset()
- func (x *DownRequest) String() string
- func (m *DownRequest) Validate() error
- type DownRequestValidationError
- func (e DownRequestValidationError) Cause() error
- func (e DownRequestValidationError) Error() string
- func (e DownRequestValidationError) ErrorName() string
- func (e DownRequestValidationError) Field() string
- func (e DownRequestValidationError) Key() bool
- func (e DownRequestValidationError) Reason() string
- type DownResult
- func (*DownResult) Descriptor() ([]byte, []int)deprecated
- func (x *DownResult) GetCompletedLength() uint64
- func (x *DownResult) GetDone() bool
- func (x *DownResult) GetPeerId() string
- func (x *DownResult) GetTaskId() string
- func (*DownResult) ProtoMessage()
- func (x *DownResult) ProtoReflect() protoreflect.Message
- func (x *DownResult) Reset()
- func (x *DownResult) String() string
- func (m *DownResult) Validate() error
- type DownResultValidationError
- type UnimplementedDaemonServer
- func (UnimplementedDaemonServer) CheckHealth(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
- func (UnimplementedDaemonServer) Download(*DownRequest, Daemon_DownloadServer) error
- func (UnimplementedDaemonServer) GetPieceTasks(context.Context, *base.PieceTaskRequest) (*base.PiecePacket, error)
- type UnsafeDaemonServer
Constants ¶
This section is empty.
Variables ¶
var Daemon_ServiceDesc = grpc.ServiceDesc{ ServiceName: "dfdaemon.Daemon", HandlerType: (*DaemonServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetPieceTasks", Handler: _Daemon_GetPieceTasks_Handler, }, { MethodName: "CheckHealth", Handler: _Daemon_CheckHealth_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Download", Handler: _Daemon_Download_Handler, ServerStreams: true, }, }, Metadata: "pkg/rpc/dfdaemon/dfdaemon.proto", }
Daemon_ServiceDesc is the grpc.ServiceDesc for Daemon service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_pkg_rpc_dfdaemon_dfdaemon_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDaemonServer ¶
func RegisterDaemonServer(s grpc.ServiceRegistrar, srv DaemonServer)
Types ¶
type DaemonClient ¶
type DaemonClient interface { // Trigger client to download file Download(ctx context.Context, in *DownRequest, opts ...grpc.CallOption) (Daemon_DownloadClient, error) // Get piece tasks from other peers GetPieceTasks(ctx context.Context, in *base.PieceTaskRequest, opts ...grpc.CallOption) (*base.PiecePacket, error) // Check daemon health CheckHealth(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) }
DaemonClient is the client API for Daemon 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 NewDaemonClient ¶
func NewDaemonClient(cc grpc.ClientConnInterface) DaemonClient
type DaemonServer ¶
type DaemonServer interface { // Trigger client to download file Download(*DownRequest, Daemon_DownloadServer) error // Get piece tasks from other peers GetPieceTasks(context.Context, *base.PieceTaskRequest) (*base.PiecePacket, error) // Check daemon health CheckHealth(context.Context, *emptypb.Empty) (*emptypb.Empty, error) // contains filtered or unexported methods }
DaemonServer is the server API for Daemon service. All implementations must embed UnimplementedDaemonServer for forward compatibility
type Daemon_DownloadClient ¶
type Daemon_DownloadClient interface { Recv() (*DownResult, error) grpc.ClientStream }
type Daemon_DownloadServer ¶
type Daemon_DownloadServer interface { Send(*DownResult) error grpc.ServerStream }
type DownRequest ¶
type DownRequest struct { // identify one downloading, the framework will fill it automatically Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // download file from the url, not only for http Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` // pieces will be written to output path directly, // at the same time, dfdaemon workspace also makes soft link to the output Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` // timeout duration Timeout int64 `protobuf:"varint,4,opt,name=timeout,proto3" json:"timeout,omitempty"` // rate limit in bytes per second Limit float64 `protobuf:"fixed64,5,opt,name=limit,proto3" json:"limit,omitempty"` DisableBackSource bool `protobuf:"varint,6,opt,name=disable_back_source,json=disableBackSource,proto3" json:"disable_back_source,omitempty"` UrlMeta *base.UrlMeta `protobuf:"bytes,7,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"` // p2p/cdn/source Pattern string `protobuf:"bytes,8,opt,name=pattern,proto3" json:"pattern,omitempty"` // call system Callsystem string `protobuf:"bytes,9,opt,name=callsystem,proto3" json:"callsystem,omitempty"` // user id Uid int64 `protobuf:"varint,10,opt,name=uid,proto3" json:"uid,omitempty"` // group id Gid int64 `protobuf:"varint,11,opt,name=gid,proto3" json:"gid,omitempty"` // contains filtered or unexported fields }
func (*DownRequest) Descriptor
deprecated
func (*DownRequest) Descriptor() ([]byte, []int)
Deprecated: Use DownRequest.ProtoReflect.Descriptor instead.
func (*DownRequest) GetCallsystem ¶
func (x *DownRequest) GetCallsystem() string
func (*DownRequest) GetDisableBackSource ¶
func (x *DownRequest) GetDisableBackSource() bool
func (*DownRequest) GetGid ¶
func (x *DownRequest) GetGid() int64
func (*DownRequest) GetLimit ¶
func (x *DownRequest) GetLimit() float64
func (*DownRequest) GetOutput ¶
func (x *DownRequest) GetOutput() string
func (*DownRequest) GetPattern ¶
func (x *DownRequest) GetPattern() string
func (*DownRequest) GetTimeout ¶
func (x *DownRequest) GetTimeout() int64
func (*DownRequest) GetUid ¶
func (x *DownRequest) GetUid() int64
func (*DownRequest) GetUrl ¶
func (x *DownRequest) GetUrl() string
func (*DownRequest) GetUrlMeta ¶
func (x *DownRequest) GetUrlMeta() *base.UrlMeta
func (*DownRequest) GetUuid ¶
func (x *DownRequest) GetUuid() string
func (*DownRequest) ProtoMessage ¶
func (*DownRequest) ProtoMessage()
func (*DownRequest) ProtoReflect ¶
func (x *DownRequest) ProtoReflect() protoreflect.Message
func (*DownRequest) Reset ¶
func (x *DownRequest) Reset()
func (*DownRequest) String ¶
func (x *DownRequest) String() string
func (*DownRequest) Validate ¶
func (m *DownRequest) Validate() error
Validate checks the field values on DownRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type DownRequestValidationError ¶
type DownRequestValidationError struct {
// contains filtered or unexported fields
}
DownRequestValidationError is the validation error returned by DownRequest.Validate if the designated constraints aren't met.
func (DownRequestValidationError) Cause ¶
func (e DownRequestValidationError) Cause() error
Cause function returns cause value.
func (DownRequestValidationError) Error ¶
func (e DownRequestValidationError) Error() string
Error satisfies the builtin error interface
func (DownRequestValidationError) ErrorName ¶
func (e DownRequestValidationError) ErrorName() string
ErrorName returns error name.
func (DownRequestValidationError) Field ¶
func (e DownRequestValidationError) Field() string
Field function returns field value.
func (DownRequestValidationError) Key ¶
func (e DownRequestValidationError) Key() bool
Key function returns key value.
func (DownRequestValidationError) Reason ¶
func (e DownRequestValidationError) Reason() string
Reason function returns reason value.
type DownResult ¶
type DownResult struct { TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"` PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` CompletedLength uint64 `protobuf:"varint,4,opt,name=completed_length,json=completedLength,proto3" json:"completed_length,omitempty"` Done bool `protobuf:"varint,5,opt,name=done,proto3" json:"done,omitempty"` // contains filtered or unexported fields }
func (*DownResult) Descriptor
deprecated
func (*DownResult) Descriptor() ([]byte, []int)
Deprecated: Use DownResult.ProtoReflect.Descriptor instead.
func (*DownResult) GetCompletedLength ¶
func (x *DownResult) GetCompletedLength() uint64
func (*DownResult) GetDone ¶
func (x *DownResult) GetDone() bool
func (*DownResult) GetPeerId ¶
func (x *DownResult) GetPeerId() string
func (*DownResult) GetTaskId ¶
func (x *DownResult) GetTaskId() string
func (*DownResult) ProtoMessage ¶
func (*DownResult) ProtoMessage()
func (*DownResult) ProtoReflect ¶
func (x *DownResult) ProtoReflect() protoreflect.Message
func (*DownResult) Reset ¶
func (x *DownResult) Reset()
func (*DownResult) String ¶
func (x *DownResult) String() string
func (*DownResult) Validate ¶
func (m *DownResult) Validate() error
Validate checks the field values on DownResult with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type DownResultValidationError ¶
type DownResultValidationError struct {
// contains filtered or unexported fields
}
DownResultValidationError is the validation error returned by DownResult.Validate if the designated constraints aren't met.
func (DownResultValidationError) Cause ¶
func (e DownResultValidationError) Cause() error
Cause function returns cause value.
func (DownResultValidationError) Error ¶
func (e DownResultValidationError) Error() string
Error satisfies the builtin error interface
func (DownResultValidationError) ErrorName ¶
func (e DownResultValidationError) ErrorName() string
ErrorName returns error name.
func (DownResultValidationError) Field ¶
func (e DownResultValidationError) Field() string
Field function returns field value.
func (DownResultValidationError) Key ¶
func (e DownResultValidationError) Key() bool
Key function returns key value.
func (DownResultValidationError) Reason ¶
func (e DownResultValidationError) Reason() string
Reason function returns reason value.
type UnimplementedDaemonServer ¶
type UnimplementedDaemonServer struct { }
UnimplementedDaemonServer must be embedded to have forward compatible implementations.
func (UnimplementedDaemonServer) CheckHealth ¶
func (UnimplementedDaemonServer) Download ¶
func (UnimplementedDaemonServer) Download(*DownRequest, Daemon_DownloadServer) error
func (UnimplementedDaemonServer) GetPieceTasks ¶
func (UnimplementedDaemonServer) GetPieceTasks(context.Context, *base.PieceTaskRequest) (*base.PiecePacket, error)
type UnsafeDaemonServer ¶
type UnsafeDaemonServer interface {
// contains filtered or unexported methods
}
UnsafeDaemonServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DaemonServer will result in compilation errors.