fs

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package fs contains the FTP implementation of the fuse.FileSystemInterface, and the FuseHost that can mount it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FTPClient

type FTPClient interface {
	fuse.FileSystemInterface

	// SetAddress will quit open connections, change the address, and reconnect
	// The method is intended to be used when a FUSE mount must survive a change of
	// FTP server address.
	SetAddress(addr netip.AddrPort) error
}

func NewFTPClient

func NewFTPClient(ctx context.Context, addr netip.AddrPort, dir string, readTimeout time.Duration) (FTPClient, error)

NewFTPClient returns an implementation of the fuse.FileSystemInterface that is backed by an FTP server connection tp the address. The dir parameter is the directory that the FTP server changes to when connecting.

type FuseHost

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

FuseHost wraps a fuse.FileSystemHost and adds Start/Stop semantics

func NewHost

func NewHost(fsh fuse.FileSystemInterface, mountPoint string) *FuseHost

NewHost creates a FuseHost instance that will mount the given filesystem on the given mountPoint.

func (*FuseHost) Start

func (fh *FuseHost) Start(ctx context.Context, startTimeout time.Duration) error

Start will mount the filesystem on the mountPoint passed to NewHost.

func (*FuseHost) Stop

func (fh *FuseHost) Stop()

Stop will unmount the file system and terminate the FTP client, wait for all clean-up to complete, and then return

Jump to

Keyboard shortcuts

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