ftp

package
v3.41.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSH_FXF_READ   = 0x00000001
	SSH_FXF_WRITE  = 0x00000002
	SSH_FXF_APPEND = 0x00000004
	SSH_FXF_CREAT  = 0x00000008
	SSH_FXF_TRUNC  = 0x00000010
	SSH_FXF_EXCL   = 0x00000020
)

From leffss/sftpd

Variables

This section is empty.

Functions

func HandleSIZE

func HandleSIZE(param string, client ftpserver.ClientDriver) (int, string)

func List

func List(ctx context.Context, path string) ([]os.FileInfo, error)

func Mkdir

func Mkdir(ctx context.Context, path string) error

func Remove

func Remove(ctx context.Context, path string) error

func Rename

func Rename(ctx context.Context, oldPath, newPath string) error

func Stat

func Stat(ctx context.Context, path string) (os.FileInfo, error)

Types

type AferoAdapter

type AferoAdapter struct {
	// contains filtered or unexported fields
}

func NewAferoAdapter

func NewAferoAdapter(ctx context.Context) *AferoAdapter

func (*AferoAdapter) Chmod

func (a *AferoAdapter) Chmod(_ string, _ os.FileMode) error

func (*AferoAdapter) Chown

func (a *AferoAdapter) Chown(_ string, _, _ int) error

func (*AferoAdapter) Chtimes

func (a *AferoAdapter) Chtimes(_ string, _ time.Time, _ time.Time) error

func (*AferoAdapter) Create

func (a *AferoAdapter) Create(_ string) (afero.File, error)

func (*AferoAdapter) GetHandle

func (a *AferoAdapter) GetHandle(name string, flags int, offset int64) (ftpserver.FileTransfer, error)

func (*AferoAdapter) Mkdir

func (a *AferoAdapter) Mkdir(name string, _ os.FileMode) error

func (*AferoAdapter) MkdirAll

func (a *AferoAdapter) MkdirAll(path string, perm os.FileMode) error

func (*AferoAdapter) Name

func (a *AferoAdapter) Name() string

func (*AferoAdapter) Open

func (a *AferoAdapter) Open(_ string) (afero.File, error)

func (*AferoAdapter) OpenFile

func (a *AferoAdapter) OpenFile(_ string, _ int, _ os.FileMode) (afero.File, error)

func (*AferoAdapter) ReadDir

func (a *AferoAdapter) ReadDir(name string) ([]os.FileInfo, error)

func (*AferoAdapter) Remove

func (a *AferoAdapter) Remove(name string) error

func (*AferoAdapter) RemoveAll

func (a *AferoAdapter) RemoveAll(path string) error

func (*AferoAdapter) Rename

func (a *AferoAdapter) Rename(oldName, newName string) error

func (*AferoAdapter) SetNextFileSize

func (a *AferoAdapter) SetNextFileSize(size int64)

func (*AferoAdapter) Stat

func (a *AferoAdapter) Stat(name string) (os.FileInfo, error)

type FileDownloadProxy

type FileDownloadProxy struct {
	ftpserver.FileTransfer
	// contains filtered or unexported fields
}

func OpenDownload

func OpenDownload(ctx context.Context, path string) (*FileDownloadProxy, error)

func (*FileDownloadProxy) Close

func (f *FileDownloadProxy) Close() error

func (*FileDownloadProxy) Read

func (f *FileDownloadProxy) Read(p []byte) (n int, err error)

func (*FileDownloadProxy) Seek

func (f *FileDownloadProxy) Seek(offset int64, whence int) (int64, error)

func (*FileDownloadProxy) Write

func (f *FileDownloadProxy) Write(p []byte) (n int, err error)

type FileUploadProxy

type FileUploadProxy struct {
	ftpserver.FileTransfer
	// contains filtered or unexported fields
}

func OpenUpload

func OpenUpload(ctx context.Context, path string, trunc bool) (*FileUploadProxy, error)

func (*FileUploadProxy) Close

func (f *FileUploadProxy) Close() error

func (*FileUploadProxy) Read

func (f *FileUploadProxy) Read(p []byte) (n int, err error)

func (*FileUploadProxy) Seek

func (f *FileUploadProxy) Seek(offset int64, whence int) (int64, error)

func (*FileUploadProxy) Write

func (f *FileUploadProxy) Write(p []byte) (n int, err error)

type FileUploadWithLengthProxy

type FileUploadWithLengthProxy struct {
	ftpserver.FileTransfer
	// contains filtered or unexported fields
}

func OpenUploadWithLength

func OpenUploadWithLength(ctx context.Context, path string, trunc bool, length int64) (*FileUploadWithLengthProxy, error)

func (*FileUploadWithLengthProxy) Close

func (f *FileUploadWithLengthProxy) Close() error

func (*FileUploadWithLengthProxy) Read

func (f *FileUploadWithLengthProxy) Read(p []byte) (n int, err error)

func (*FileUploadWithLengthProxy) Seek

func (f *FileUploadWithLengthProxy) Seek(offset int64, whence int) (int64, error)

func (*FileUploadWithLengthProxy) Write

func (f *FileUploadWithLengthProxy) Write(p []byte) (n int, err error)

type OsFileInfoAdapter

type OsFileInfoAdapter struct {
	// contains filtered or unexported fields
}

func (*OsFileInfoAdapter) IsDir

func (o *OsFileInfoAdapter) IsDir() bool

func (*OsFileInfoAdapter) ModTime

func (o *OsFileInfoAdapter) ModTime() time.Time

func (*OsFileInfoAdapter) Mode

func (o *OsFileInfoAdapter) Mode() fs2.FileMode

func (*OsFileInfoAdapter) Name

func (o *OsFileInfoAdapter) Name() string

func (*OsFileInfoAdapter) Size

func (o *OsFileInfoAdapter) Size() int64

func (*OsFileInfoAdapter) Sys

func (o *OsFileInfoAdapter) Sys() any

type SftpDriverAdapter

type SftpDriverAdapter struct {
	FtpDriver *AferoAdapter
}
func (s *SftpDriverAdapter) CreateLink(_, _ string, _ uint32) error

func (*SftpDriverAdapter) GetHandle

func (s *SftpDriverAdapter) GetHandle(name string, flags uint32, _ *sftpd.Attr, offset uint64) (sftpd.FileTransfer, error)

func (*SftpDriverAdapter) Mkdir

func (s *SftpDriverAdapter) Mkdir(name string, attr *sftpd.Attr) error

func (*SftpDriverAdapter) OpenDir

func (s *SftpDriverAdapter) OpenDir(_ string) (sftpd.Dir, error)

func (*SftpDriverAdapter) OpenFile

func (s *SftpDriverAdapter) OpenFile(_ string, _ uint32, _ *sftpd.Attr) (sftpd.File, error)

func (*SftpDriverAdapter) ReadDir

func (s *SftpDriverAdapter) ReadDir(name string) ([]sftpd.NamedAttr, error)
func (s *SftpDriverAdapter) ReadLink(_ string) (string, error)

func (*SftpDriverAdapter) RealPath

func (s *SftpDriverAdapter) RealPath(path string) (string, error)

func (*SftpDriverAdapter) Remove

func (s *SftpDriverAdapter) Remove(name string) error

func (*SftpDriverAdapter) Rename

func (s *SftpDriverAdapter) Rename(old, new string, _ uint32) error

func (*SftpDriverAdapter) Rmdir

func (s *SftpDriverAdapter) Rmdir(name string) error

func (*SftpDriverAdapter) SetStat

func (s *SftpDriverAdapter) SetStat(_ string, _ *sftpd.Attr) error

func (*SftpDriverAdapter) Stat

func (s *SftpDriverAdapter) Stat(name string, _ bool) (*sftpd.Attr, error)

Jump to

Keyboard shortcuts

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