dfdaemon

package
v2.0.163 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 23

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PeerState_name = map[int32]string{
		0: "Unknown",
		1: "Running",
		2: "Success",
		3: "Failed",
		4: "Deleted",
	}
	PeerState_value = map[string]int32{
		"Unknown": 0,
		"Running": 1,
		"Success": 2,
		"Failed":  3,
		"Deleted": 4,
	}
)

Enum value maps for PeerState.

View Source
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,
		},
		{
			MethodName: "StatTask",
			Handler:    _Daemon_StatTask_Handler,
		},
		{
			MethodName: "ImportTask",
			Handler:    _Daemon_ImportTask_Handler,
		},
		{
			MethodName: "ExportTask",
			Handler:    _Daemon_ExportTask_Handler,
		},
		{
			MethodName: "DeleteTask",
			Handler:    _Daemon_DeleteTask_Handler,
		},
		{
			MethodName: "LeaveHost",
			Handler:    _Daemon_LeaveHost_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Download",
			Handler:       _Daemon_Download_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "SyncPieceTasks",
			Handler:       _Daemon_SyncPieceTasks_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "PeerExchange",
			Handler:       _Daemon_PeerExchange_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "pkg/apis/dfdaemon/v1/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)

View Source
var File_pkg_apis_dfdaemon_v1_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 *v1.PieceTaskRequest, opts ...grpc.CallOption) (*v1.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)
	// LeaveHost releases host in scheduler.
	LeaveHost(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// Exchange peers between daemons
	PeerExchange(ctx context.Context, opts ...grpc.CallOption) (Daemon_PeerExchangeClient, 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, *v1.PieceTaskRequest) (*v1.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)
	// LeaveHost releases host in scheduler.
	LeaveHost(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
	// Exchange peers between daemons
	PeerExchange(Daemon_PeerExchangeServer) error
}

DaemonServer is the server API for Daemon service. All implementations should 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 Daemon_PeerExchangeClient added in v2.0.107

type Daemon_PeerExchangeClient interface {
	Send(*PeerExchangeData) error
	Recv() (*PeerExchangeData, error)
	grpc.ClientStream
}

type Daemon_PeerExchangeServer added in v2.0.107

type Daemon_PeerExchangeServer interface {
	Send(*PeerExchangeData) error
	Recv() (*PeerExchangeData, error)
	grpc.ServerStream
}

type Daemon_SyncPieceTasksClient

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

type Daemon_SyncPieceTasksServer

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

type DeleteTaskRequest

type DeleteTaskRequest struct {

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

func (*DeleteTaskRequest) Descriptor deprecated

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

Deprecated: Use DeleteTaskRequest.ProtoReflect.Descriptor instead.

func (*DeleteTaskRequest) GetUrl

func (x *DeleteTaskRequest) GetUrl() string

func (*DeleteTaskRequest) GetUrlMeta

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

func (*DeleteTaskRequest) ProtoMessage

func (*DeleteTaskRequest) ProtoMessage()

func (*DeleteTaskRequest) ProtoReflect

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

func (*DeleteTaskRequest) Reset

func (x *DeleteTaskRequest) Reset()

func (*DeleteTaskRequest) String

func (x *DeleteTaskRequest) String() string

func (*DeleteTaskRequest) Validate

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, the first error encountered is returned, or nil if there are no violations.

func (*DeleteTaskRequest) ValidateAll

func (m *DeleteTaskRequest) ValidateAll() error

ValidateAll checks the field values on DeleteTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DeleteTaskRequestMultiError, or nil if none found.

type DeleteTaskRequestMultiError

type DeleteTaskRequestMultiError []error

DeleteTaskRequestMultiError is an error wrapping multiple validation errors returned by DeleteTaskRequest.ValidateAll() if the designated constraints aren't met.

func (DeleteTaskRequestMultiError) AllErrors

func (m DeleteTaskRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteTaskRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type DeleteTaskRequestValidationError

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

Cause function returns cause value.

func (DeleteTaskRequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteTaskRequestValidationError) ErrorName

ErrorName returns error name.

func (DeleteTaskRequestValidationError) Field

Field function returns field value.

func (DeleteTaskRequestValidationError) Key

Key function returns key value.

func (DeleteTaskRequestValidationError) Reason

Reason function returns reason value.

type DownRequest

type DownRequest struct {

	// Identify one downloading, the framework will fill it automatically.
	// Deprecated
	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 *v1.UrlMeta `protobuf:"bytes,7,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,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"`
	// Recursive download, when enabled, daemon will call resource list api to list and then recursive download each object.
	Recursive bool `protobuf:"varint,13,opt,name=recursive,proto3" json:"recursive,omitempty"`
	// contains filtered or unexported fields
}

func (*DownRequest) Descriptor deprecated

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

Deprecated: Use DownRequest.ProtoReflect.Descriptor instead.

func (*DownRequest) GetDisableBackSource

func (x *DownRequest) GetDisableBackSource() bool

func (*DownRequest) GetGid

func (x *DownRequest) GetGid() int64

func (*DownRequest) GetKeepOriginalOffset

func (x *DownRequest) GetKeepOriginalOffset() bool

func (*DownRequest) GetLimit

func (x *DownRequest) GetLimit() float64

func (*DownRequest) GetOutput

func (x *DownRequest) GetOutput() string

func (*DownRequest) GetRecursive

func (x *DownRequest) GetRecursive() bool

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() *v1.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, the first error encountered is returned, or nil if there are no violations.

func (*DownRequest) ValidateAll

func (m *DownRequest) ValidateAll() error

ValidateAll checks the field values on DownRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DownRequestMultiError, or nil if none found.

type DownRequestMultiError

type DownRequestMultiError []error

DownRequestMultiError is an error wrapping multiple validation errors returned by DownRequest.ValidateAll() if the designated constraints aren't met.

func (DownRequestMultiError) AllErrors

func (m DownRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DownRequestMultiError) Error

func (m DownRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

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"`
	// Task output. Used in recursive download.
	Output string `protobuf:"bytes,6,opt,name=output,proto3" json:"output,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) GetOutput

func (x *DownResult) GetOutput() string

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, the first error encountered is returned, or nil if there are no violations.

func (*DownResult) ValidateAll

func (m *DownResult) ValidateAll() error

ValidateAll checks the field values on DownResult with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DownResultMultiError, or nil if none found.

type DownResultMultiError

type DownResultMultiError []error

DownResultMultiError is an error wrapping multiple validation errors returned by DownResult.ValidateAll() if the designated constraints aren't met.

func (DownResultMultiError) AllErrors

func (m DownResultMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DownResultMultiError) Error

func (m DownResultMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

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

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 *v1.UrlMeta `protobuf:"bytes,5,opt,name=url_meta,json=urlMeta,proto3" json:"url_meta,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

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

Deprecated: Use ExportTaskRequest.ProtoReflect.Descriptor instead.

func (*ExportTaskRequest) GetGid

func (x *ExportTaskRequest) GetGid() int64

func (*ExportTaskRequest) GetLimit

func (x *ExportTaskRequest) GetLimit() float64

func (*ExportTaskRequest) GetLocalOnly

func (x *ExportTaskRequest) GetLocalOnly() bool

func (*ExportTaskRequest) GetOutput

func (x *ExportTaskRequest) GetOutput() string

func (*ExportTaskRequest) GetTimeout

func (x *ExportTaskRequest) GetTimeout() uint64

func (*ExportTaskRequest) GetUid

func (x *ExportTaskRequest) GetUid() int64

func (*ExportTaskRequest) GetUrl

func (x *ExportTaskRequest) GetUrl() string

func (*ExportTaskRequest) GetUrlMeta

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

func (*ExportTaskRequest) ProtoMessage

func (*ExportTaskRequest) ProtoMessage()

func (*ExportTaskRequest) ProtoReflect

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

func (*ExportTaskRequest) Reset

func (x *ExportTaskRequest) Reset()

func (*ExportTaskRequest) String

func (x *ExportTaskRequest) String() string

func (*ExportTaskRequest) Validate

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, the first error encountered is returned, or nil if there are no violations.

func (*ExportTaskRequest) ValidateAll

func (m *ExportTaskRequest) ValidateAll() error

ValidateAll checks the field values on ExportTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ExportTaskRequestMultiError, or nil if none found.

type ExportTaskRequestMultiError

type ExportTaskRequestMultiError []error

ExportTaskRequestMultiError is an error wrapping multiple validation errors returned by ExportTaskRequest.ValidateAll() if the designated constraints aren't met.

func (ExportTaskRequestMultiError) AllErrors

func (m ExportTaskRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExportTaskRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ExportTaskRequestValidationError

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

Cause function returns cause value.

func (ExportTaskRequestValidationError) Error

Error satisfies the builtin error interface

func (ExportTaskRequestValidationError) ErrorName

ErrorName returns error name.

func (ExportTaskRequestValidationError) Field

Field function returns field value.

func (ExportTaskRequestValidationError) Key

Key function returns key value.

func (ExportTaskRequestValidationError) Reason

Reason function returns reason value.

type ImportTaskRequest

type ImportTaskRequest struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// URL meta info.
	UrlMeta *v1.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 v1.TaskType `protobuf:"varint,4,opt,name=type,proto3,enum=common.TaskType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*ImportTaskRequest) Descriptor deprecated

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

Deprecated: Use ImportTaskRequest.ProtoReflect.Descriptor instead.

func (*ImportTaskRequest) GetPath

func (x *ImportTaskRequest) GetPath() string

func (*ImportTaskRequest) GetType

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

func (*ImportTaskRequest) GetUrl

func (x *ImportTaskRequest) GetUrl() string

func (*ImportTaskRequest) GetUrlMeta

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

func (*ImportTaskRequest) ProtoMessage

func (*ImportTaskRequest) ProtoMessage()

func (*ImportTaskRequest) ProtoReflect

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

func (*ImportTaskRequest) Reset

func (x *ImportTaskRequest) Reset()

func (*ImportTaskRequest) String

func (x *ImportTaskRequest) String() string

func (*ImportTaskRequest) Validate

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, the first error encountered is returned, or nil if there are no violations.

func (*ImportTaskRequest) ValidateAll

func (m *ImportTaskRequest) ValidateAll() error

ValidateAll checks the field values on ImportTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ImportTaskRequestMultiError, or nil if none found.

type ImportTaskRequestMultiError

type ImportTaskRequestMultiError []error

ImportTaskRequestMultiError is an error wrapping multiple validation errors returned by ImportTaskRequest.ValidateAll() if the designated constraints aren't met.

func (ImportTaskRequestMultiError) AllErrors

func (m ImportTaskRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ImportTaskRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ImportTaskRequestValidationError

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

Cause function returns cause value.

func (ImportTaskRequestValidationError) Error

Error satisfies the builtin error interface

func (ImportTaskRequestValidationError) ErrorName

ErrorName returns error name.

func (ImportTaskRequestValidationError) Field

Field function returns field value.

func (ImportTaskRequestValidationError) Key

Key function returns key value.

func (ImportTaskRequestValidationError) Reason

Reason function returns reason value.

type PeerExchangeData added in v2.0.107

type PeerExchangeData struct {
	PeerMetadatas []*PeerMetadata `protobuf:"bytes,1,rep,name=PeerMetadatas,proto3" json:"PeerMetadatas,omitempty"`
	// contains filtered or unexported fields
}

PeerExchangeData represents metadata of peer tasks.

func (*PeerExchangeData) Descriptor deprecated added in v2.0.107

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

Deprecated: Use PeerExchangeData.ProtoReflect.Descriptor instead.

func (*PeerExchangeData) GetPeerMetadatas added in v2.0.107

func (x *PeerExchangeData) GetPeerMetadatas() []*PeerMetadata

func (*PeerExchangeData) ProtoMessage added in v2.0.107

func (*PeerExchangeData) ProtoMessage()

func (*PeerExchangeData) ProtoReflect added in v2.0.107

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

func (*PeerExchangeData) Reset added in v2.0.107

func (x *PeerExchangeData) Reset()

func (*PeerExchangeData) String added in v2.0.107

func (x *PeerExchangeData) String() string

func (*PeerExchangeData) Validate added in v2.0.107

func (m *PeerExchangeData) Validate() error

Validate checks the field values on PeerExchangeData with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PeerExchangeData) ValidateAll added in v2.0.107

func (m *PeerExchangeData) ValidateAll() error

ValidateAll checks the field values on PeerExchangeData with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PeerExchangeDataMultiError, or nil if none found.

type PeerExchangeDataMultiError added in v2.0.107

type PeerExchangeDataMultiError []error

PeerExchangeDataMultiError is an error wrapping multiple validation errors returned by PeerExchangeData.ValidateAll() if the designated constraints aren't met.

func (PeerExchangeDataMultiError) AllErrors added in v2.0.107

func (m PeerExchangeDataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PeerExchangeDataMultiError) Error added in v2.0.107

Error returns a concatenation of all the error messages it wraps.

type PeerExchangeDataValidationError added in v2.0.107

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

PeerExchangeDataValidationError is the validation error returned by PeerExchangeData.Validate if the designated constraints aren't met.

func (PeerExchangeDataValidationError) Cause added in v2.0.107

Cause function returns cause value.

func (PeerExchangeDataValidationError) Error added in v2.0.107

Error satisfies the builtin error interface

func (PeerExchangeDataValidationError) ErrorName added in v2.0.107

ErrorName returns error name.

func (PeerExchangeDataValidationError) Field added in v2.0.107

Field function returns field value.

func (PeerExchangeDataValidationError) Key added in v2.0.107

Key function returns key value.

func (PeerExchangeDataValidationError) Reason added in v2.0.107

Reason function returns reason value.

type PeerMetadata added in v2.0.107

type PeerMetadata struct {
	TaskId string    `protobuf:"bytes,1,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	PeerId string    `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
	State  PeerState `protobuf:"varint,3,opt,name=state,proto3,enum=dfdaemon.PeerState" json:"state,omitempty"`
	// contains filtered or unexported fields
}

PeerMetadata represents metadata of a peer task.

func (*PeerMetadata) Descriptor deprecated added in v2.0.107

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

Deprecated: Use PeerMetadata.ProtoReflect.Descriptor instead.

func (*PeerMetadata) GetPeerId added in v2.0.107

func (x *PeerMetadata) GetPeerId() string

func (*PeerMetadata) GetState added in v2.0.107

func (x *PeerMetadata) GetState() PeerState

func (*PeerMetadata) GetTaskId added in v2.0.107

func (x *PeerMetadata) GetTaskId() string

func (*PeerMetadata) ProtoMessage added in v2.0.107

func (*PeerMetadata) ProtoMessage()

func (*PeerMetadata) ProtoReflect added in v2.0.107

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

func (*PeerMetadata) Reset added in v2.0.107

func (x *PeerMetadata) Reset()

func (*PeerMetadata) String added in v2.0.107

func (x *PeerMetadata) String() string

func (*PeerMetadata) Validate added in v2.0.107

func (m *PeerMetadata) Validate() error

Validate checks the field values on PeerMetadata with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PeerMetadata) ValidateAll added in v2.0.107

func (m *PeerMetadata) ValidateAll() error

ValidateAll checks the field values on PeerMetadata with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PeerMetadataMultiError, or nil if none found.

type PeerMetadataMultiError added in v2.0.107

type PeerMetadataMultiError []error

PeerMetadataMultiError is an error wrapping multiple validation errors returned by PeerMetadata.ValidateAll() if the designated constraints aren't met.

func (PeerMetadataMultiError) AllErrors added in v2.0.107

func (m PeerMetadataMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PeerMetadataMultiError) Error added in v2.0.107

func (m PeerMetadataMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type PeerMetadataValidationError added in v2.0.107

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

PeerMetadataValidationError is the validation error returned by PeerMetadata.Validate if the designated constraints aren't met.

func (PeerMetadataValidationError) Cause added in v2.0.107

Cause function returns cause value.

func (PeerMetadataValidationError) Error added in v2.0.107

Error satisfies the builtin error interface

func (PeerMetadataValidationError) ErrorName added in v2.0.107

func (e PeerMetadataValidationError) ErrorName() string

ErrorName returns error name.

func (PeerMetadataValidationError) Field added in v2.0.107

Field function returns field value.

func (PeerMetadataValidationError) Key added in v2.0.107

Key function returns key value.

func (PeerMetadataValidationError) Reason added in v2.0.107

Reason function returns reason value.

type PeerState added in v2.0.107

type PeerState int32

PeerState represents state of peer task.

const (
	PeerState_Unknown PeerState = 0
	PeerState_Running PeerState = 1
	PeerState_Success PeerState = 2
	PeerState_Failed  PeerState = 3
	PeerState_Deleted PeerState = 4
)

func (PeerState) Descriptor added in v2.0.107

func (PeerState) Descriptor() protoreflect.EnumDescriptor

func (PeerState) Enum added in v2.0.107

func (x PeerState) Enum() *PeerState

func (PeerState) EnumDescriptor deprecated added in v2.0.107

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

Deprecated: Use PeerState.Descriptor instead.

func (PeerState) Number added in v2.0.107

func (x PeerState) Number() protoreflect.EnumNumber

func (PeerState) String added in v2.0.107

func (x PeerState) String() string

func (PeerState) Type added in v2.0.107

type StatTaskRequest

type StatTaskRequest struct {

	// Download url.
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// URL meta info.
	UrlMeta *v1.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

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

Deprecated: Use StatTaskRequest.ProtoReflect.Descriptor instead.

func (*StatTaskRequest) GetLocalOnly

func (x *StatTaskRequest) GetLocalOnly() bool

func (*StatTaskRequest) GetUrl

func (x *StatTaskRequest) GetUrl() string

func (*StatTaskRequest) GetUrlMeta

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

func (*StatTaskRequest) ProtoMessage

func (*StatTaskRequest) ProtoMessage()

func (*StatTaskRequest) ProtoReflect

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

func (*StatTaskRequest) Reset

func (x *StatTaskRequest) Reset()

func (*StatTaskRequest) String

func (x *StatTaskRequest) String() string

func (*StatTaskRequest) Validate

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, the first error encountered is returned, or nil if there are no violations.

func (*StatTaskRequest) ValidateAll

func (m *StatTaskRequest) ValidateAll() error

ValidateAll checks the field values on StatTaskRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in StatTaskRequestMultiError, or nil if none found.

type StatTaskRequestMultiError

type StatTaskRequestMultiError []error

StatTaskRequestMultiError is an error wrapping multiple validation errors returned by StatTaskRequest.ValidateAll() if the designated constraints aren't met.

func (StatTaskRequestMultiError) AllErrors

func (m StatTaskRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (StatTaskRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type StatTaskRequestValidationError

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

Cause function returns cause value.

func (StatTaskRequestValidationError) Error

Error satisfies the builtin error interface

func (StatTaskRequestValidationError) ErrorName

func (e StatTaskRequestValidationError) ErrorName() string

ErrorName returns error name.

func (StatTaskRequestValidationError) Field

Field function returns field value.

func (StatTaskRequestValidationError) Key

Key function returns key value.

func (StatTaskRequestValidationError) Reason

Reason function returns reason value.

type UnimplementedDaemonServer

type UnimplementedDaemonServer struct {
}

UnimplementedDaemonServer should be embedded to have forward compatible implementations.

func (UnimplementedDaemonServer) CheckHealth

func (UnimplementedDaemonServer) DeleteTask

func (UnimplementedDaemonServer) Download

func (UnimplementedDaemonServer) ExportTask

func (UnimplementedDaemonServer) GetPieceTasks

func (UnimplementedDaemonServer) ImportTask

func (UnimplementedDaemonServer) LeaveHost added in v2.0.93

func (UnimplementedDaemonServer) PeerExchange added in v2.0.107

func (UnimplementedDaemonServer) StatTask

func (UnimplementedDaemonServer) SyncPieceTasks

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.

Directories

Path Synopsis
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