uploader

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 31 Imported by: 2

Documentation

Overview

Package uploader implements an uploader server. It is the important role - peer - in P2P pattern that will wait for other P2PDownloader to download its downloaded files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinishTask

func FinishTask(ip string, port int, taskFileName, cid, taskID, node string) error

FinishTask reports a finished task to peer server.

func FuzzParseParams added in v1.0.5

func FuzzParseParams(data []byte) int

func LaunchPeerServer

func LaunchPeerServer(cfg *config.Config) (int, error)

LaunchPeerServer launches a server to send piece data.

func SetupPeerServerExecutor

func SetupPeerServerExecutor(executor PeerServerExecutor)

SetupPeerServerExecutor setup a giving executor instance instead of default implementation.

func StartPeerServerProcess

func StartPeerServerProcess(cfg *config.Config) (port int, err error)

StartPeerServerProcess starts an independent peer server process for uploading downloaded files if it doesn't exist. This function is invoked when dfget starts to download files in p2p pattern.

func WaitForShutdown

func WaitForShutdown()

WaitForShutdown waits for peer server shutdown.

Types

type PeerServerExecutor

type PeerServerExecutor interface {
	StartPeerServerProcess(cfg *config.Config) (port int, err error)
}

PeerServerExecutor starts an independent peer server process for uploading downloaded files.

func GetPeerServerExecutor

func GetPeerServerExecutor() PeerServerExecutor

GetPeerServerExecutor returns the current executor instance.

Jump to

Keyboard shortcuts

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