localfs

package
v2.0.0-...-896e392 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: BSD-2-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	*os.File
	// contains filtered or unexported fields
}

File wraps an os.File to provide the additional operations necessary to implement sftp.FileHandler.

func (*File) Handle

func (f *File) Handle() string

Handle returns the SFTP handle associated with the file.

func (*File) ReadDir

func (f *File) ReadDir(maxDataLen uint32) (entries []*sshfx.NameEntry, err error)

ReadDir overrides the os.File.ReadDir receiver method by converting the slice of fs.DirEntry into into a slice of sshfx.NameEntry.

func (*File) SetStat

func (f *File) SetStat(attrs *sshfx.Attributes) (err error)

SetStat implements sftp.SetStatFileHandler.

func (*File) Stat

func (f *File) Stat() (*sshfx.Attributes, error)

Stat overrides the os.File.Stat receiver method by converting the fs.FileInfo into a sshfx.Attributes.

func (*File) StatVFS

func (f *File) StatVFS() (*openssh.StatVFSExtendedReplyPacket, error)

StatVFS implements ssh.StatVFSFileHandler.

type ServerHandler

type ServerHandler struct {
	sftp.UnimplementedServerHandler

	ReadOnly bool
	WorkDir  string
	// contains filtered or unexported fields
}

ServerHandler implements the sftp.ServerHandler interface using the local filesystem as the filesystem. NOTE: This is not normally a safe thing to expose.

func (*ServerHandler) LStat

LStat implements sftp.ServerHandler.

func (*ServerHandler) LookupGroupName

func (*ServerHandler) LookupGroupName(gid string) string

LookupGroupName returns the OS group name for the given gid.

func (*ServerHandler) LookupUserName

func (*ServerHandler) LookupUserName(uid string) string

LookupUserName returns the OS username for the given uid.

func (*ServerHandler) Mkdir

func (h *ServerHandler) Mkdir(_ context.Context, req *sshfx.MkdirPacket) error

Mkdir implements sftp.ServerHandler.

func (*ServerHandler) Open

Open implements sftp.ServerHandler.

func (*ServerHandler) OpenDir

OpenDir implements sftp.ServerHandler.

func (*ServerHandler) POSIXRename

POSIXRename implements sftp.POSIXRenameServerHandler.

func (h *ServerHandler) ReadLink(_ context.Context, req *sshfx.ReadLinkPacket) (string, error)

ReadLink implements sftp.ServerHandler.

func (*ServerHandler) RealPath

func (h *ServerHandler) RealPath(_ context.Context, req *sshfx.RealPathPacket) (string, error)

RealPath implements sftp.ServerHandler.

func (*ServerHandler) Remove

func (h *ServerHandler) Remove(_ context.Context, req *sshfx.RemovePacket) error

Remove implements sftp.ServerHandler.

func (*ServerHandler) Rename

func (h *ServerHandler) Rename(_ context.Context, req *sshfx.RenamePacket) error

Rename implements sftp.ServerHandler.

func (*ServerHandler) Rmdir

func (h *ServerHandler) Rmdir(_ context.Context, req *sshfx.RmdirPacket) error

Rmdir implements sftp.ServerHandler.

func (*ServerHandler) SetStat

func (h *ServerHandler) SetStat(_ context.Context, req *sshfx.SetStatPacket) error

SetStat implements sftp.ServerHandler.

func (*ServerHandler) Stat

Stat implements sftp.ServerHandler.

func (*ServerHandler) StatVFS

StatVFS implements ssh.StatVFSServerHandler.

func (h *ServerHandler) Symlink(_ context.Context, req *sshfx.SymlinkPacket) error

Symlink implements sftp.ServerHandler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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