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 ¶
- func FinishTask(ip string, port int, taskFileName, cid, taskID, node string) error
- func LaunchPeerServer(cfg *config.Config) (int, error)
- func SetupPeerServerExecutor(executor PeerServerExecutor)
- func StartPeerServerProcess(cfg *config.Config) (port int, err error)
- func WaitForShutdown()
- type PeerServerExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FinishTask ¶
FinishTask report a finished task to peer server.
func LaunchPeerServer ¶
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 ¶
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.
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.