client

package
v2.0.7-beta.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v2.0.6

type Client interface {
	// Trigger client to download file.
	Download(context.Context, *dfdaemonv1.DownRequest, ...grpc.CallOption) (dfdaemonv1.Daemon_DownloadClient, error)

	// Get piece tasks from other peers.
	GetPieceTasks(context.Context, *commonv1.PieceTaskRequest, ...grpc.CallOption) (*commonv1.PiecePacket, error)

	// Sync piece tasks with other peers.
	SyncPieceTasks(context.Context, *commonv1.PieceTaskRequest, ...grpc.CallOption) (dfdaemonv1.Daemon_SyncPieceTasksClient, error)

	// Check if given task exists in P2P cache system.
	StatTask(context.Context, *dfdaemonv1.StatTaskRequest, ...grpc.CallOption) error

	// Import the given file into P2P cache system.
	ImportTask(context.Context, *dfdaemonv1.ImportTaskRequest, ...grpc.CallOption) error

	// Export or download file from P2P cache system.
	ExportTask(context.Context, *dfdaemonv1.ExportTaskRequest, ...grpc.CallOption) error

	// Delete file from P2P cache system.
	DeleteTask(context.Context, *dfdaemonv1.DeleteTaskRequest, ...grpc.CallOption) error

	// Check daemon health.
	CheckHealth(context.Context, ...grpc.CallOption) error

	// Close tears down the ClientConn and all underlying connections.
	Close() error
}

Client is the interface for grpc client.

func GetClient added in v2.0.6

func GetClient(ctx context.Context, target string, opts ...grpc.DialOption) (Client, error)

GetClient returns dfdaemon client.

func GetInsecureClient added in v2.0.6

func GetInsecureClient(ctx context.Context, target string, opts ...grpc.DialOption) (Client, error)

GetInsecureClient returns dfdaemon client. FIXME use GetClient + insecure.NewCredentials instead of this function

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