dfdaemon

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_pkg_rpc_dfdaemon_dfdaemon_proto protoreflect.FileDescriptor

Functions

func RegisterDaemonServer

func RegisterDaemonServer(s *grpc.Server, 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)
	// Sync piece tasks with other peers
	SyncPieceTasks(ctx context.Context, opts ...grpc.CallOption) (Daemon_SyncPieceTasksClient, error)
	// Check if given task exists in P2P cache system
	StatTask(ctx context.Context, in *StatTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Import the given file into P2P cache system
	ImportTask(ctx context.Context, in *ImportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Export or download file from P2P cache system
	ExportTask(ctx context.Context, in *ExportTaskRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Delete file from P2P cache system
	DeleteTask(ctx context.Context, in *DeleteTaskRequest, 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://godoc.org/google.golang.org/grpc#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)
	// Sync piece tasks with other peers
	SyncPieceTasks(Daemon_SyncPieceTasksServer) error
	// Check if given task exists in P2P cache system
	StatTask(context.Context, *StatTaskRequest) (*emptypb.Empty, error)
	// Import the given file into P2P cache system
	ImportTask(context.Context, *ImportTaskRequest) (*emptypb.Empty, error)
	// Export or download file from P2P cache system
	ExportTask(context.Context, *ExportTaskRequest) (*emptypb.Empty, error)
	// Delete file from P2P cache system
	DeleteTask(context.Context, *DeleteTaskRequest) (*emptypb.Empty, error)
}

DaemonServer is the server API for Daemon service.

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 Daemon_SyncPieceTasksClient added in v2.0.2

type Daemon_SyncPieceTasksClient interface {
	Send(*base.PieceTaskRequest) error
	Recv() (*base.PiecePacket, error)
	grpc.ClientStream
}

type Daemon_SyncPieceTasksServer added in v2.0.2

type Daemon_SyncPieceTasksServer interface {
	Send(*base.PiecePacket) error
	Recv() (*base.PieceTaskRequest, error)
	grpc.ServerStream
}

type DeleteTaskRequest added in v2.0.3

type DeleteTaskRequest struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// URL meta info.
	UrlMeta *base.UrlMeta `protobuf:"bytes,2,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteTaskRequest) Descriptor deprecated added in v2.0.3

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

Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead.

func (*DeleteTaskRequest) GetUrl added in v2.0.4

func (x *DeleteTaskRequest) GetUrl() string

func (*DeleteTaskRequest) GetUrlMeta added in v2.0.3

func (x *DeleteTaskRequest) GetUrlMeta() *base.UrlMeta

func (*DeleteTaskRequest) ProtoMessage added in v2.0.3

func (*DeleteTaskRequest) ProtoMessage()

func (*DeleteTaskRequest) ProtoReflect added in v2.0.3

func (x *DeleteTaskRequest) ProtoReflect() protoreflect.Message

func (*DeleteTaskRequest) Reset added in v2.0.3

func (x *DeleteTaskRequest) Reset()

func (*DeleteTaskRequest) String added in v2.0.3

func (x *DeleteTaskRequest) String() string

func (*DeleteTaskRequest) Validate added in v2.0.3

func (m *DeleteTaskRequest) Validate() error

Validate checks the field values on DeleteTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type DeleteTaskRequestValidationError added in v2.0.3

type DeleteTaskRequestValidationError struct {
	// contains filtered or unexported fields
}

DeleteTaskRequestValidationError is the validation error returned by DeleteTaskRequest.Validate if the designated constraints aren't met.

func (DeleteTaskRequestValidationError) Cause added in v2.0.3

Cause function returns cause value.

func (DeleteTaskRequestValidationError) Error added in v2.0.3

Error satisfies the builtin error interface

func (DeleteTaskRequestValidationError) ErrorName added in v2.0.3

ErrorName returns error name.

func (DeleteTaskRequestValidationError) Field added in v2.0.3

Field function returns field value.

func (DeleteTaskRequestValidationError) Key added in v2.0.3

Key function returns key value.

func (DeleteTaskRequestValidationError) Reason added in v2.0.3

Reason function returns reason value.

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 uint64 `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"`
	// Disable back-to-source.
	DisableBackSource bool `protobuf:"varint,6,opt,name=disable_back_source,json=disableBackSource,proto3" json:"disable_back_source,omitempty"`
	// URL meta info.
	UrlMeta *base.UrlMeta `protobuf:"bytes,7,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
	// Pattern has p2p/seed-peer/source, default is p2p.
	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"`
	// Keep original offset, used for ranged request, only available for hard link, otherwise will failed.
	KeepOriginalOffset bool `protobuf:"varint,12,opt,name=keep_original_offset,json=keepOriginalOffset,proto3" json:"keep_original_offset,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) GetKeepOriginalOffset added in v2.0.2

func (x *DownRequest) GetKeepOriginalOffset() bool

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() uint64

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

Cause function returns cause value.

func (DownRequestValidationError) Error

Error satisfies the builtin error interface

func (DownRequestValidationError) ErrorName

func (e DownRequestValidationError) ErrorName() string

ErrorName returns error name.

func (DownRequestValidationError) Field

Field function returns field value.

func (DownRequestValidationError) Key

Key function returns key value.

func (DownRequestValidationError) Reason

Reason function returns reason value.

type DownResult

type DownResult struct {

	// Task id.
	TaskId string `protobuf:"bytes,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	// Peer id.
	PeerId string `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	// Task has completed length.
	CompletedLength uint64 `protobuf:"varint,4,opt,name=completed_length,json=completedLength,proto3" json:"completed_length,omitempty"`
	// Task has been completed.
	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

Error satisfies the builtin error interface

func (DownResultValidationError) ErrorName

func (e DownResultValidationError) ErrorName() string

ErrorName returns error name.

func (DownResultValidationError) Field

Field function returns field value.

func (DownResultValidationError) Key

Key function returns key value.

func (DownResultValidationError) Reason

func (e DownResultValidationError) Reason() string

Reason function returns reason value.

type ExportTaskRequest added in v2.0.3

type ExportTaskRequest struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Output path of downloaded file.
	Output string `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"`
	// Timeout duration.
	Timeout uint64 `protobuf:"varint,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// Rate limit in bytes per second.
	Limit float64 `protobuf:"fixed64,4,opt,name=limit,proto3" json:"limit,omitempty"`
	// URL meta info.
	UrlMeta *base.UrlMeta `protobuf:"bytes,5,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
	// Call system.
	Callsystem string `protobuf:"bytes,6,opt,name=callsystem,proto3" json:"callsystem,omitempty"`
	// User id.
	Uid int64 `protobuf:"varint,7,opt,name=uid,proto3" json:"uid,omitempty"`
	// Group id.
	Gid int64 `protobuf:"varint,8,opt,name=gid,proto3" json:"gid,omitempty"`
	// Only export from local storage.
	LocalOnly bool `protobuf:"varint,9,opt,name=local_only,json=localOnly,proto3" json:"local_only,omitempty"`
	// contains filtered or unexported fields
}

func (*ExportTaskRequest) Descriptor deprecated added in v2.0.3

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

Deprecated: Use ExportTaskRequest.ProtoReflect.Descriptor instead.

func (*ExportTaskRequest) GetCallsystem added in v2.0.3

func (x *ExportTaskRequest) GetCallsystem() string

func (*ExportTaskRequest) GetGid added in v2.0.3

func (x *ExportTaskRequest) GetGid() int64

func (*ExportTaskRequest) GetLimit added in v2.0.3

func (x *ExportTaskRequest) GetLimit() float64

func (*ExportTaskRequest) GetLocalOnly added in v2.0.3

func (x *ExportTaskRequest) GetLocalOnly() bool

func (*ExportTaskRequest) GetOutput added in v2.0.3

func (x *ExportTaskRequest) GetOutput() string

func (*ExportTaskRequest) GetTimeout added in v2.0.3

func (x *ExportTaskRequest) GetTimeout() uint64

func (*ExportTaskRequest) GetUid added in v2.0.3

func (x *ExportTaskRequest) GetUid() int64

func (*ExportTaskRequest) GetUrl added in v2.0.4

func (x *ExportTaskRequest) GetUrl() string

func (*ExportTaskRequest) GetUrlMeta added in v2.0.3

func (x *ExportTaskRequest) GetUrlMeta() *base.UrlMeta

func (*ExportTaskRequest) ProtoMessage added in v2.0.3

func (*ExportTaskRequest) ProtoMessage()

func (*ExportTaskRequest) ProtoReflect added in v2.0.3

func (x *ExportTaskRequest) ProtoReflect() protoreflect.Message

func (*ExportTaskRequest) Reset added in v2.0.3

func (x *ExportTaskRequest) Reset()

func (*ExportTaskRequest) String added in v2.0.3

func (x *ExportTaskRequest) String() string

func (*ExportTaskRequest) Validate added in v2.0.3

func (m *ExportTaskRequest) Validate() error

Validate checks the field values on ExportTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ExportTaskRequestValidationError added in v2.0.3

type ExportTaskRequestValidationError struct {
	// contains filtered or unexported fields
}

ExportTaskRequestValidationError is the validation error returned by ExportTaskRequest.Validate if the designated constraints aren't met.

func (ExportTaskRequestValidationError) Cause added in v2.0.3

Cause function returns cause value.

func (ExportTaskRequestValidationError) Error added in v2.0.3

Error satisfies the builtin error interface

func (ExportTaskRequestValidationError) ErrorName added in v2.0.3

ErrorName returns error name.

func (ExportTaskRequestValidationError) Field added in v2.0.3

Field function returns field value.

func (ExportTaskRequestValidationError) Key added in v2.0.3

Key function returns key value.

func (ExportTaskRequestValidationError) Reason added in v2.0.3

Reason function returns reason value.

type ImportTaskRequest added in v2.0.3

type ImportTaskRequest struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// URL meta info.
	UrlMeta *base.UrlMeta `protobuf:"bytes,2,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
	// File to be imported.
	Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
	// Task type.
	Type base.TaskType `protobuf:"varint,4,opt,name=type,proto3,enum=base.TaskType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportTaskRequest) Descriptor deprecated added in v2.0.3

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

Deprecated: Use ImportTaskRequest.ProtoReflect.Descriptor instead.

func (*ImportTaskRequest) GetPath added in v2.0.3

func (x *ImportTaskRequest) GetPath() string

func (*ImportTaskRequest) GetType added in v2.0.4

func (x *ImportTaskRequest) GetType() base.TaskType

func (*ImportTaskRequest) GetUrl added in v2.0.4

func (x *ImportTaskRequest) GetUrl() string

func (*ImportTaskRequest) GetUrlMeta added in v2.0.3

func (x *ImportTaskRequest) GetUrlMeta() *base.UrlMeta

func (*ImportTaskRequest) ProtoMessage added in v2.0.3

func (*ImportTaskRequest) ProtoMessage()

func (*ImportTaskRequest) ProtoReflect added in v2.0.3

func (x *ImportTaskRequest) ProtoReflect() protoreflect.Message

func (*ImportTaskRequest) Reset added in v2.0.3

func (x *ImportTaskRequest) Reset()

func (*ImportTaskRequest) String added in v2.0.3

func (x *ImportTaskRequest) String() string

func (*ImportTaskRequest) Validate added in v2.0.3

func (m *ImportTaskRequest) Validate() error

Validate checks the field values on ImportTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ImportTaskRequestValidationError added in v2.0.3

type ImportTaskRequestValidationError struct {
	// contains filtered or unexported fields
}

ImportTaskRequestValidationError is the validation error returned by ImportTaskRequest.Validate if the designated constraints aren't met.

func (ImportTaskRequestValidationError) Cause added in v2.0.3

Cause function returns cause value.

func (ImportTaskRequestValidationError) Error added in v2.0.3

Error satisfies the builtin error interface

func (ImportTaskRequestValidationError) ErrorName added in v2.0.3

ErrorName returns error name.

func (ImportTaskRequestValidationError) Field added in v2.0.3

Field function returns field value.

func (ImportTaskRequestValidationError) Key added in v2.0.3

Key function returns key value.

func (ImportTaskRequestValidationError) Reason added in v2.0.3

Reason function returns reason value.

type StatTaskRequest added in v2.0.3

type StatTaskRequest struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// URL meta info.
	UrlMeta *base.UrlMeta `protobuf:"bytes,2,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,omitempty"`
	// Check local cache only.
	LocalOnly bool `protobuf:"varint,3,opt,name=local_only,json=localOnly,proto3" json:"local_only,omitempty"`
	// contains filtered or unexported fields
}

func (*StatTaskRequest) Descriptor deprecated added in v2.0.3

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

Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead.

func (*StatTaskRequest) GetLocalOnly added in v2.0.3

func (x *StatTaskRequest) GetLocalOnly() bool

func (*StatTaskRequest) GetUrl added in v2.0.4

func (x *StatTaskRequest) GetUrl() string

func (*StatTaskRequest) GetUrlMeta added in v2.0.3

func (x *StatTaskRequest) GetUrlMeta() *base.UrlMeta

func (*StatTaskRequest) ProtoMessage added in v2.0.3

func (*StatTaskRequest) ProtoMessage()

func (*StatTaskRequest) ProtoReflect added in v2.0.3

func (x *StatTaskRequest) ProtoReflect() protoreflect.Message

func (*StatTaskRequest) Reset added in v2.0.3

func (x *StatTaskRequest) Reset()

func (*StatTaskRequest) String added in v2.0.3

func (x *StatTaskRequest) String() string

func (*StatTaskRequest) Validate added in v2.0.3

func (m *StatTaskRequest) Validate() error

Validate checks the field values on StatTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type StatTaskRequestValidationError added in v2.0.3

type StatTaskRequestValidationError struct {
	// contains filtered or unexported fields
}

StatTaskRequestValidationError is the validation error returned by StatTaskRequest.Validate if the designated constraints aren't met.

func (StatTaskRequestValidationError) Cause added in v2.0.3

Cause function returns cause value.

func (StatTaskRequestValidationError) Error added in v2.0.3

Error satisfies the builtin error interface

func (StatTaskRequestValidationError) ErrorName added in v2.0.3

func (e StatTaskRequestValidationError) ErrorName() string

ErrorName returns error name.

func (StatTaskRequestValidationError) Field added in v2.0.3

Field function returns field value.

func (StatTaskRequestValidationError) Key added in v2.0.3

Key function returns key value.

func (StatTaskRequestValidationError) Reason added in v2.0.3

Reason function returns reason value.

type UnimplementedDaemonServer

type UnimplementedDaemonServer struct {
}

UnimplementedDaemonServer can be embedded to have forward compatible implementations.

func (*UnimplementedDaemonServer) CheckHealth

func (*UnimplementedDaemonServer) DeleteTask added in v2.0.3

func (*UnimplementedDaemonServer) Download

func (*UnimplementedDaemonServer) ExportTask added in v2.0.3

func (*UnimplementedDaemonServer) GetPieceTasks

func (*UnimplementedDaemonServer) ImportTask added in v2.0.3

func (*UnimplementedDaemonServer) StatTask added in v2.0.3

func (*UnimplementedDaemonServer) SyncPieceTasks added in v2.0.2

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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