Documentation ¶
Index ¶
- func DefaultConnector(c *Config) (*sftp.Client, error)
- func Search(client *sftp.Client, query string, typ string, nums ...int) []string
- type Config
- type Connector
- type SftpManager
- func (s *SftpManager) Chmod(ctx echo.Context, ppath string, mode os.FileMode) error
- func (s *SftpManager) Chown(ctx echo.Context, ppath string, uid, gid int) error
- func (s *SftpManager) Client() *sftp.Client
- func (s *SftpManager) Close() error
- func (s *SftpManager) ConnError() error
- func (s *SftpManager) Connect() error
- func (s *SftpManager) Edit(ctx echo.Context, ppath string, content string, encoding string) (interface{}, error)
- func (s *SftpManager) List(ctx echo.Context, ppath string, sortBy ...string) (err error, exit bool, dirs []os.FileInfo)
- func (s *SftpManager) ListTransfer(dirs []os.FileInfo) (dirList []echo.H, fileList []echo.H)
- func (s *SftpManager) Mkdir(ctx echo.Context, ppath, newName string) error
- func (s *SftpManager) MkdirAll(_ context.Context, dirPath string) error
- func (s *SftpManager) Put(ctx context.Context, reader io.Reader, ppath string, size int64) (err error)
- func (s *SftpManager) Remove(ppath string) error
- func (s *SftpManager) RemoveDir(ppath string) error
- func (s *SftpManager) Rename(ctx echo.Context, ppath, newName string) error
- func (s *SftpManager) Search(ppath string, prefix string, num int) []string
- func (s *SftpManager) Upload(ctx echo.Context, ppath string, chunkUpload *uploadClient.ChunkUpload, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `db:"host" bson:"host" comment:"主机名" json:"host" xml:"host"` Port int `db:"port" bson:"port" comment:"端口" json:"port" xml:"port"` Username string `db:"username" bson:"username" comment:"用户名" json:"username" xml:"username"` Password string `db:"password" bson:"password" comment:"密码" json:"password" xml:"password"` PrivateKey string `db:"private_key" bson:"private_key" comment:"私钥内容" json:"private_key" xml:"private_key"` Passphrase string `db:"passphrase" bson:"passphrase" comment:"私钥口令" json:"passphrase" xml:"passphrase"` }
Config 配置
type SftpManager ¶
type SftpManager struct { EditableMaxSize int // contains filtered or unexported fields }
func (*SftpManager) Client ¶
func (s *SftpManager) Client() *sftp.Client
func (*SftpManager) Close ¶
func (s *SftpManager) Close() error
func (*SftpManager) ConnError ¶
func (s *SftpManager) ConnError() error
func (*SftpManager) Connect ¶
func (s *SftpManager) Connect() error
func (*SftpManager) ListTransfer ¶
func (*SftpManager) Mkdir ¶
func (s *SftpManager) Mkdir(ctx echo.Context, ppath, newName string) error
func (*SftpManager) MkdirAll ¶ added in v5.2.1
func (s *SftpManager) MkdirAll(_ context.Context, dirPath string) error
func (*SftpManager) Remove ¶
func (s *SftpManager) Remove(ppath string) error
func (*SftpManager) RemoveDir ¶ added in v5.2.1
func (s *SftpManager) RemoveDir(ppath string) error
func (*SftpManager) Rename ¶
func (s *SftpManager) Rename(ctx echo.Context, ppath, newName string) error
func (*SftpManager) Search ¶
func (s *SftpManager) Search(ppath string, prefix string, num int) []string
func (*SftpManager) Upload ¶
func (s *SftpManager) Upload(ctx echo.Context, ppath string, chunkUpload *uploadClient.ChunkUpload, chunkOpts ...uploadClient.ChunkInfoOpter) error
Click to show internal directories.
Click to hide internal directories.