ftpfs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package ftpfs adapts github.com/jlaffaye/ftp to ShellCN's shared file browser.

Index

Constants

View Source
const (
	DefaultFTPPort  = 21
	DefaultFTPSPort = 990
)

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, cfg plugin.ConnectConfig, opts Options) (plugin.Session, error)

Types

type Client

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

func (*Client) Copy

func (c *Client) Copy(_ context.Context, src, dst string) error

Copy duplicates src to dst. A single FTP control connection allows only one active data transfer, so the source is fully drained (and its data connection closed) before the upload begins.

func (*Client) Home

func (c *Client) Home(context.Context) (string, error)

func (*Client) MapError

func (c *Client) MapError(err error) error

func (*Client) Mkdir

func (c *Client) Mkdir(_ context.Context, p string) error

func (*Client) Move

func (c *Client) Move(_ context.Context, src, dst string) error

Move renames src to dst (RNFR/RNTO).

func (*Client) Open

func (c *Client) Open(_ context.Context, p string) (io.ReadCloser, error)

func (*Client) OpenRange

func (c *Client) OpenRange(_ context.Context, p string, offset, _ int64) (io.ReadCloser, error)

OpenRange reads from offset via REST/RETR; the single connection is held until Close, so ranged reads serialize.

func (*Client) ReadDir

func (c *Client) ReadDir(_ context.Context, p string) ([]os.FileInfo, error)

func (*Client) Remove

func (c *Client) Remove(_ context.Context, p string, isDir bool) error

func (*Client) Rename

func (c *Client) Rename(_ context.Context, from, to string) error

func (*Client) Stat

func (c *Client) Stat(_ context.Context, p string) (os.FileInfo, error)

func (*Client) Write

func (c *Client) Write(_ context.Context, p string, r io.Reader) error

type Options

type Options struct {
	Host      string
	Port      int
	Auth      string
	Username  string
	Password  string
	RootPath  string
	TLSMode   TLSMode
	VerifyTLS bool
}

type Session

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

func NewSession

func NewSession(client *Client) *Session

func (*Session) Close

func (s *Session) Close() error

func (*Session) Filesystem

func (s *Session) Filesystem() (filesystem.Client, error)

func (*Session) HealthCheck

func (s *Session) HealthCheck(context.Context) error

func (*Session) OpenChannel

type TLSMode

type TLSMode string
const (
	TLSNone     TLSMode = "none"
	TLSExplicit TLSMode = "explicit"
	TLSImplicit TLSMode = "implicit"
)

Jump to

Keyboard shortcuts

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