dfdaemon

package
v0.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: Apache-2.0 Imports: 21 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.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

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 {
	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

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 UnimplementedDaemonServer

type UnimplementedDaemonServer struct {
}

UnimplementedDaemonServer must be embedded to have forward compatible implementations.

func (UnimplementedDaemonServer) CheckHealth

func (UnimplementedDaemonServer) Download

func (UnimplementedDaemonServer) GetPieceTasks

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

Jump to

Keyboard shortcuts

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