afos

package
v0.0.0-...-9fb7553 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(basePath string, opts ...func(*Afos)) fs.FS

func WithDataPath

func WithDataPath(val string) func(server *Afos)

func WithDiskSpaceValidator

func WithDiskSpaceValidator(val func(fs fs.FS) bool) func(server *Afos)

func WithPathValidator

func WithPathValidator(val func(fs fs.FS, p string) (string, error)) func(server *Afos)

func WithPermissions

func WithPermissions(val []string) func(server *Afos)

func WithReadOnly

func WithReadOnly(val bool) func(server *Afos)

Types

type Afos

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

Afos ... A file system exposed to a user.

func (*Afos) Conn

func (f *Afos) Conn() *ssh.ServerConn

func (*Afos) Context

func (f *Afos) Context() map[string]string

func (*Afos) Filecmd

func (f *Afos) Filecmd(request *sftp.Request) error

Filecmd hander for basic SFTP system calls related to files, but not anything to do with reading or writing to those files.

func (*Afos) Filelist

func (f *Afos) Filelist(request *sftp.Request) (sftp.ListerAt, error)

Filelist is the handler for SFTP filesystem list calls. This will handle calls to list the contents of a directory as well as perform file/folder stat calls.

func (*Afos) Fileread

func (f *Afos) Fileread(request *sftp.Request) (io.ReaderAt, error)

Fileread creates a reader for a file on the system and returns the reader back.

func (*Afos) Filewrite

func (f *Afos) Filewrite(request *sftp.Request) (io.WriterAt, error)

Filewrite handles the write actions for a file on the system.

func (*Afos) Logger

func (f *Afos) Logger() log.Logger

func (*Afos) Permissions

func (f *Afos) Permissions() []string

func (*Afos) SetConn

func (f *Afos) SetConn(sconn *ssh.ServerConn)

func (*Afos) SetContext

func (f *Afos) SetContext(ctx map[string]string)

func (*Afos) SetID

func (f *Afos) SetID(p string)

func (*Afos) SetLogger

func (f *Afos) SetLogger(logger log.Logger)

func (*Afos) SetPermissions

func (f *Afos) SetPermissions(p []string)

func (*Afos) Type

func (f *Afos) Type() string

Jump to

Keyboard shortcuts

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