datachannel

package
v0.0.0-...-1310e1d Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package datachannel handles the data sink between the FTP Server and the client

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataChanneler

type DataChanneler interface {
	io.Closer
	Port() int
	ToPASVStringPort() string
	Open() error
	Sink(f SinkFunction)
	IsClosed() bool
	Encrypted() bool
	SetEncrypted(encrypt bool)
}

DataChanneler is the interface exposed to handle PASV connections and data handling

func New

func New(pa portassigner.PortAssigner, cert *tls.Certificate, encrypted bool) (DataChanneler, error)

New initializes a new DataChanneler You must call Open before calling the Sink method or the socket won't be open (nor accepting connections)

type SinkFunction

type SinkFunction func(io.Writer, io.Reader) error

SinkFunction is the function that will be called when the client connects to the PASV port. The DataChanneler is responsible of closing the socket after the function returns.

Jump to

Keyboard shortcuts

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