fileserver

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

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

Go to latest
Published: May 19, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectionFailed = errors.New("Couldn't connect")

Functions

This section is empty.

Types

type Config

type Config = config.FileServerConfig

type LocalFileServer

type LocalFileServer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLocalFileServer

func NewLocalFileServer(cfg Config) (*LocalFileServer, error)

func (*LocalFileServer) AcquireLock

func (fs *LocalFileServer) AcquireLock(ctx context.Context, filePath string) (Locker, error)

func (*LocalFileServer) Glob

func (fs *LocalFileServer) Glob(ctx context.Context, pattern string) ([]string, error)

func (*LocalFileServer) Move

func (fs *LocalFileServer) Move(ctx context.Context, oldname, newname string) error

func (*LocalFileServer) Open

func (fs *LocalFileServer) Open(ctx context.Context, filePath string) (io.ReadSeekCloser, error)

func (*LocalFileServer) Remove

func (fs *LocalFileServer) Remove(ctx context.Context, filePath string) error

func (*LocalFileServer) Stat

func (fs *LocalFileServer) Stat(ctx context.Context, filepath string) (fs.FileInfo, error)

type Locker

type Locker = models.Locker

type SFTPFileServer

type SFTPFileServer struct {
	KeyExchanges []string
	// contains filtered or unexported fields
}

func NewSFTP

func NewSFTP(cfg Config, keyExchanges ...string) (*SFTPFileServer, error)

func (*SFTPFileServer) Glob

func (fs *SFTPFileServer) Glob(ctx context.Context, pattern string) ([]string, error)

func (*SFTPFileServer) Lock

func (fs *SFTPFileServer) Lock(ctx context.Context, filePath string) error

func (*SFTPFileServer) Move

func (fs *SFTPFileServer) Move(ctx context.Context, oldname, newname string) error

func (*SFTPFileServer) Open

func (fs *SFTPFileServer) Open(ctx context.Context, filePath string) (io.ReadSeekCloser, error)

func (*SFTPFileServer) Remove

func (fs *SFTPFileServer) Remove(ctx context.Context, filePath string) error

func (*SFTPFileServer) Stat

func (fs *SFTPFileServer) Stat(ctx context.Context, filePath string) (fs.FileInfo, error)

func (*SFTPFileServer) Unlock

func (fs *SFTPFileServer) Unlock(ctx context.Context, filepath string) error

Jump to

Keyboard shortcuts

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