uploader

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2019 License: Apache-2.0 Imports: 27 Imported by: 0

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 report a finished task to peer server.

func LaunchPeerServer

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

LaunchPeerServer launch 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 wait 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