Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CredentialStore ¶
type CredentialStore interface {
GetSFTPCredential(string) (store.SFTPCredential, error)
}
type Manager ¶
type Manager interface {
List(context.Context, string, string) ([]FileInfo, error)
Read(context.Context, string, string) (io.ReadCloser, error)
Write(context.Context, string, string, io.Reader) error
Delete(context.Context, string, string, bool) error
Rename(context.Context, string, string, string) error
Copy(context.Context, string, string, string) error
CreateDir(context.Context, string, string) error
ResolvePath(string, string) (string, error)
}
func NewManager ¶
type SFTPServer ¶
type SFTPServer struct {
// contains filtered or unexported fields
}
SFTPServer provides an isolated SSH listener. File operations are delegated to Manager; the transport accepts only registered public-key credentials.
func NewSFTPServer ¶
func NewSFTPServer(cfg config.SFTPConfig, manager Manager, creds CredentialStore) (*SFTPServer, error)
func (*SFTPServer) Addr ¶
func (s *SFTPServer) Addr() net.Addr
func (*SFTPServer) ListenAndServe ¶
func (s *SFTPServer) ListenAndServe(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.