Documentation ¶
Index ¶
- Variables
- func SetDefaults(c *Config)
- type Auth
- type Config
- func (c *Config) Init() *Config
- func (c *Config) SetAuth(auth ftpserver.Auth) *Config
- func (c *Config) SetAuthByType(storeType string) *Config
- func (c *Config) SetDriver(driver ftpserver.Driver) *Config
- func (c *Config) SetPerm(perm ftpserver.Perm, owner string, group string) *Config
- func (c *Config) SetPermByType(storeType string, owner string, group string) *Config
- func (c *Config) SetPort(port int) *Config
- func (c *Config) SetStoreByType(storeType string, options ...map[string]string) *Config
- func (c *Config) Start() error
- type FileDriver
- func (driver *FileDriver) ChangeDir(ftpCtx *ftpserver.Context, path string) error
- func (driver *FileDriver) DeleteDir(ftpCtx *ftpserver.Context, path string) error
- func (driver *FileDriver) DeleteFile(ftpCtx *ftpserver.Context, path string) error
- func (driver *FileDriver) GetFile(ftpCtx *ftpserver.Context, path string, offset int64) (int64, io.ReadCloser, error)
- func (driver *FileDriver) ListDir(ftpCtx *ftpserver.Context, path string, callback func(os.FileInfo) error) error
- func (driver *FileDriver) MakeDir(ftpCtx *ftpserver.Context, path string) error
- func (driver *FileDriver) PutFile(ftpCtx *ftpserver.Context, destPath string, data io.Reader, offset int64) (int64, error)
- func (driver *FileDriver) Rename(ftpCtx *ftpserver.Context, fromPath string, toPath string) error
- func (driver *FileDriver) Stat(ftpCtx *ftpserver.Context, path string) (os.FileInfo, error)
- type FileInfo
- type Perm
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultConfig = &Config{ PidFile: `ftp.pid`, DBType: `mysql`, FTPStoreType: `file`, Name: `TinyFTP`, PassivePorts: `6001-7000`, Port: 25, PublicIP: `127.0.0.1`, WelcomeMessage: `Welcome to the TinyFTP`, } DefaultPidFile = `ftp.pid` )
Functions ¶
func SetDefaults ¶ added in v3.6.3
func SetDefaults(c *Config)
Types ¶
type Config ¶
type Config struct { PidFile string `json:"-"` DBType string `json:"dbType"` FTPStoreType string `json:"ftpStoreType"` FTPOptions map[string]string `json:"ftpOptions"` // Server Name, Default is Go Ftp Server Name string `json:"name"` // The hostname that the FTP server should listen on. Optional, defaults to // "::", which means all hostnames on ipv4 and ipv6. Hostname string `json:"hostName"` // Public IP of the server PublicIP string `json:"publicIP"` // Passive ports PassivePorts string `json:"passivePorts"` // The port that the FTP should listen on. Optional, defaults to 3000. In // a production environment you will probably want to change this to 21. Port int `json:"port"` // use tls, default is false TLS bool `json:"tls"` // if tls used, cert file is required CertFile string `json:"certFile"` // if tls used, key file is required KeyFile string `json:"keyFile"` // If ture TLS is used in RFC4217 mode ExplicitFTPS bool `json:"explicitFTPS"` WelcomeMessage string `json:"welcomeMessage"` // contains filtered or unexported fields }
func (*Config) SetAuthByType ¶
func (*Config) SetPermByType ¶
func (*Config) SetStoreByType ¶
type FileDriver ¶
func (*FileDriver) ChangeDir ¶
func (driver *FileDriver) ChangeDir(ftpCtx *ftpserver.Context, path string) error
func (*FileDriver) DeleteDir ¶
func (driver *FileDriver) DeleteDir(ftpCtx *ftpserver.Context, path string) error
func (*FileDriver) DeleteFile ¶
func (driver *FileDriver) DeleteFile(ftpCtx *ftpserver.Context, path string) error
func (*FileDriver) GetFile ¶
func (driver *FileDriver) GetFile(ftpCtx *ftpserver.Context, path string, offset int64) (int64, io.ReadCloser, error)
func (*FileDriver) MakeDir ¶
func (driver *FileDriver) MakeDir(ftpCtx *ftpserver.Context, path string) error
Click to show internal directories.
Click to hide internal directories.