Documentation ¶
Overview ¶
Sample driver implementation of the ftpserver library.
This sample is very limited.
Index ¶
- type SampleDriver
- func (driver *SampleDriver) AuthUser(cc server.ClientContext, user, pass string) (server.ClientHandlingDriver, error)
- func (driver *SampleDriver) CanAllocate(cc server.ClientContext, size int) (bool, error)
- func (driver *SampleDriver) ChangeDirectory(cc server.ClientContext, directory string) error
- func (driver *SampleDriver) ChmodFile(cc server.ClientContext, path string, mode os.FileMode) error
- func (driver *SampleDriver) DeleteFile(cc server.ClientContext, path string) error
- func (driver *SampleDriver) GetFileInfo(cc server.ClientContext, path string) (os.FileInfo, error)
- func (driver *SampleDriver) GetSettings() *server.Settings
- func (driver *SampleDriver) GetTLSConfig() (*tls.Config, error)
- func (driver *SampleDriver) ListFiles(cc server.ClientContext) ([]os.FileInfo, error)
- func (driver *SampleDriver) MakeDirectory(cc server.ClientContext, directory string) error
- func (driver *SampleDriver) OpenFile(cc server.ClientContext, path string, flag int) (server.FileStream, error)
- func (driver *SampleDriver) RenameFile(cc server.ClientContext, from, to string) error
- func (driver *SampleDriver) UserLeft(cc server.ClientContext)
- func (driver *SampleDriver) WelcomeUser(cc server.ClientContext) (string, error)
- type VirtualFile
- type VirtualFileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SampleDriver ¶
type SampleDriver struct {
// contains filtered or unexported fields
}
SampleDriver defines a very basic serverftp driver
func NewSampleDriver ¶
func NewSampleDriver() *SampleDriver
Note: This is not a mistake. Interface can be pointers. There seems to be a lot of confusion around this in the
server_ftp original code.
func (*SampleDriver) AuthUser ¶
func (driver *SampleDriver) AuthUser(cc server.ClientContext, user, pass string) (server.ClientHandlingDriver, error)
func (*SampleDriver) CanAllocate ¶
func (driver *SampleDriver) CanAllocate(cc server.ClientContext, size int) (bool, error)
func (*SampleDriver) ChangeDirectory ¶
func (driver *SampleDriver) ChangeDirectory(cc server.ClientContext, directory string) error
func (*SampleDriver) ChmodFile ¶
func (driver *SampleDriver) ChmodFile(cc server.ClientContext, path string, mode os.FileMode) error
func (*SampleDriver) DeleteFile ¶
func (driver *SampleDriver) DeleteFile(cc server.ClientContext, path string) error
func (*SampleDriver) GetFileInfo ¶
func (driver *SampleDriver) GetFileInfo(cc server.ClientContext, path string) (os.FileInfo, error)
func (*SampleDriver) GetSettings ¶
func (driver *SampleDriver) GetSettings() *server.Settings
func (*SampleDriver) GetTLSConfig ¶
func (driver *SampleDriver) GetTLSConfig() (*tls.Config, error)
func (*SampleDriver) ListFiles ¶
func (driver *SampleDriver) ListFiles(cc server.ClientContext) ([]os.FileInfo, error)
func (*SampleDriver) MakeDirectory ¶
func (driver *SampleDriver) MakeDirectory(cc server.ClientContext, directory string) error
func (*SampleDriver) OpenFile ¶
func (driver *SampleDriver) OpenFile(cc server.ClientContext, path string, flag int) (server.FileStream, error)
func (*SampleDriver) RenameFile ¶
func (driver *SampleDriver) RenameFile(cc server.ClientContext, from, to string) error
func (*SampleDriver) UserLeft ¶
func (driver *SampleDriver) UserLeft(cc server.ClientContext)
func (*SampleDriver) WelcomeUser ¶
func (driver *SampleDriver) WelcomeUser(cc server.ClientContext) (string, error)
type VirtualFile ¶
type VirtualFile struct {
// contains filtered or unexported fields
}
func (*VirtualFile) Close ¶
func (f *VirtualFile) Close() error
type VirtualFileInfo ¶
type VirtualFileInfo struct {
// contains filtered or unexported fields
}
func (VirtualFileInfo) IsDir ¶
func (f VirtualFileInfo) IsDir() bool
func (VirtualFileInfo) ModTime ¶
func (f VirtualFileInfo) ModTime() time.Time
func (VirtualFileInfo) Mode ¶
func (f VirtualFileInfo) Mode() os.FileMode
func (VirtualFileInfo) Name ¶
func (f VirtualFileInfo) Name() string
func (VirtualFileInfo) Size ¶
func (f VirtualFileInfo) Size() int64
func (VirtualFileInfo) Sys ¶
func (f VirtualFileInfo) Sys() interface{}
Click to show internal directories.
Click to hide internal directories.