Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cli.Command{ Name: "receive", Usage: "search for peers in your local network and the DHT", Aliases: []string{"r", "get"}, Action: Action, ArgsUsage: "[WORD-CODE]", Flags: []cli.Flag{ &cli.BoolFlag{ Name: "auto-accept", Aliases: []string{"yes", "y"}, Usage: "automatically accept the file transfer", EnvVars: []string{"PCP_AUTO_ACCEPT"}, }, }, Description: `The receive subcommand starts searching for peers in your local network by sending out multicast DNS queries. These queries are based on the current time and the first word of the given list. It simultaneously queries the distributed hash table (DHT) with the exact same parameters. It is important to note that many networks restrict the use of multicasting, which prevents mDNS from functioning. Notably, multicast cannot be used in any sort of cloud, or shared infra- structure environment. However it works well in most office, home, or private infrastructure environments. After it has found a potential peer it starts a password authen- ticated key exchange (PAKE) with the remaining three words to proof that the peer is in possession of the password. While this is happening the tool still searches for other peers as the currently connected one could fail the authentication procedure. After the authentication was successful you need to confirm the file transfer. The confirmation dialog shows the name and size of the file. The file will be saved to your current working directory overwriting any files with the same name. If the transmission fails the file will contain the partial written bytes.`, }
Command contains the receive sub-command configuration.
Functions ¶
Types ¶
type Discoverer ¶
type Node ¶
func (*Node) HandlePeer ¶
HandlePeer is called async from the discoverers. It's okay to have long running tasks here.
func (*Node) HandlePushRequest ¶
func (n *Node) HandlePushRequest(pr *p2p.PushRequest) (bool, error)
func (*Node) StartDiscovering ¶ added in v0.3.0
func (n *Node) StartDiscovering(c *cli.Context)
func (*Node) StopDiscovering ¶
func (n *Node) StopDiscovering()
func (*Node) TransferFinishHandler ¶
type TransferHandler ¶
type TransferHandler struct {
// contains filtered or unexported fields
}
func NewTransferHandler ¶
func NewTransferHandler(filename string, done chan int64) (*TransferHandler, error)
func (*TransferHandler) Done ¶ added in v0.4.0
func (th *TransferHandler) Done()
func (*TransferHandler) HandleFile ¶ added in v0.4.0
func (th *TransferHandler) HandleFile(hdr *tar.Header, src io.Reader)
Click to show internal directories.
Click to hide internal directories.