fs

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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Read ... Permission to read a file.
	Read = "read"
	// ReadContent ... Permission to read the contents of a file.
	ReadContent = "read-content"
	// Create ... Permission to create a file.
	Create = "create"
	// Update ... Permission to update a file.
	Update = "update"
	// Delete ... Permission to delete a file.
	Delete = "delete"
)

Variables

This section is empty.

Functions

func Can

func Can(permissions int64, permission string) bool

Can - Determines if a user has permission to perform a specific action on the SFTP server. These permissions are defined and returned by the Panel API.

func Deserialize

func Deserialize(perm int64) []string

func Serialize

func Serialize(perm []string) int64

Types

type AuthenticationRequest

type AuthenticationRequest struct {
	User          string `json:"username"`
	Pass          string `json:"password"`
	IP            string `json:"ip"`
	SessionID     []byte `json:"session_id"`
	ClientVersion []byte `json:"client_version"`
}

AuthenticationRequest ... An authentication request to the SFTP server.

type AuthenticationResponse

type AuthenticationResponse struct {
	Server string      `json:"server"`
	Token  string      `json:"token"`
	User   models.User `json:"user"`
}

AuthenticationResponse ... An authentication response from the SFTP server.

type FS

type FS interface {
	Fileread(request *sftp.Request) (io.ReaderAt, error)
	Filewrite(request *sftp.Request) (io.WriterAt, error)
	Filecmd(request *sftp.Request) error
	Filelist(request *sftp.Request) (sftp.ListerAt, error)
	SetLogger(logger log.Logger)
	Logger() log.Logger
	SetPermissions(p []string)
	Permissions() []string
	SetContext(ctx map[string]string)
	Context() map[string]string
	SetConn(sconn *ssh.ServerConn)
	Conn() *ssh.ServerConn
	SetID(p string)
	Type() string
}

type ListerAt

type ListerAt []os.FileInfo

ListerAt ... A list of files.

func (ListerAt) ListAt

func (l ListerAt) ListAt(f []os.FileInfo, offset int64) (int, error)

ListAt ... Returns the number of entries copied and an io.EOF error if we made it to the end of the file list. Take a look at the pkg/sftp godoc for more information about how this function should work.

Directories

Path Synopsis
Package s3 brings S3 files handling to afero
Package s3 brings S3 files handling to afero

Jump to

Keyboard shortcuts

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