Documentation
¶
Overview ¶
Package ftpd is the small FTP server cameras upload their clips to. It implements what a camera's FTP client uses -- login, directories, passive and active data connections, STOR -- and keeps every login inside its own folder. It accepts uploads and lists what it holds; it serves no downloads.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Listen is the control address, e.g. ":2121".
Listen string
// Root holds one folder per login.
Root string
// PassiveMin and PassiveMax bound the data ports offered for PASV.
PassiveMin, PassiveMax int
// PublicHost is the address told to clients for passive data; empty
// uses the address the client reached the control connection on.
PublicHost string
// Auth checks a login and returns the folder name for it.
Auth func(user, pass string) (folder string, ok bool)
// MaxFile caps one upload; 0 means 4 GiB.
MaxFile int64
// Stored is told about each file once it is fully received.
Stored func(folder, file string, size int64)
// MinFree refuses uploads while Root's disk has less than this many
// bytes free; 0 is no limit. Full is told when one is refused.
MinFree int64
Full func(free int64)
}
Config is how the server listens and where files go.