filehandlers

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileHandlerRouter added in v1.10.0

type FileHandlerRouter struct {
	FileMap map[string]ReadWriteHandler
	Cfg     *shared.ConfigSite
	DBPool  db.DB
	Spaces  []string
}

func NewFileHandlerRouter added in v1.10.0

func NewFileHandlerRouter(cfg *shared.ConfigSite, dbpool db.DB, mapper map[string]ReadWriteHandler) *FileHandlerRouter

func (*FileHandlerRouter) GetLogger added in v1.10.0

func (r *FileHandlerRouter) GetLogger() *slog.Logger

func (*FileHandlerRouter) List added in v1.10.0

func (r *FileHandlerRouter) List(s ssh.Session, fpath string, isDir bool, recursive bool) ([]os.FileInfo, error)

func (*FileHandlerRouter) Read added in v1.10.0

func (*FileHandlerRouter) Validate added in v1.10.0

func (r *FileHandlerRouter) Validate(s ssh.Session) error

func (*FileHandlerRouter) Write added in v1.10.0

func (r *FileHandlerRouter) Write(s ssh.Session, entry *utils.FileEntry) (string, error)

type PostMetaData

type PostMetaData struct {
	*db.Post
	Cur       *db.Post
	Tags      []string
	User      *db.User
	FileEntry *utils.FileEntry
	Aliases   []string
}

type ReadWriteHandler added in v1.10.0

type ReadWriteHandler interface {
	Write(ssh.Session, *utils.FileEntry) (string, error)
	Read(ssh.Session, *utils.FileEntry) (os.FileInfo, utils.ReaderAtCloser, error)
}

type ScpFileHooks

type ScpFileHooks interface {
	FileValidate(s ssh.Session, data *PostMetaData) (bool, error)
	FileMeta(s ssh.Session, data *PostMetaData) error
}

type ScpUploadHandler

type ScpUploadHandler struct {
	DBPool db.DB
	Cfg    *shared.ConfigSite
	Hooks  ScpFileHooks
}

func NewScpPostHandler

func NewScpPostHandler(dbpool db.DB, cfg *shared.ConfigSite, hooks ScpFileHooks, st storage.StorageServe) *ScpUploadHandler

func (*ScpUploadHandler) Read

func (*ScpUploadHandler) Write

func (h *ScpUploadHandler) Write(s ssh.Session, entry *utils.FileEntry) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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