sftp

package
v0.0.0-...-6c5db76 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attrs

type Attrs struct {
	Attrs []byte //  Todo Attrs structure
}

Attrs SSH_FXP_ATTRS

func (*Attrs) UnmarshalBinary

func (p *Attrs) UnmarshalBinary(data []byte) error

type Block

type Block struct {
	// Handle is returned by SSH_FXP_OPEN
	Handle string
	// Offset is the beginning of the byte-range to lock
	Offset uint64
	// Number  of bytes to lock
	Length uint64
	// A bitmask of SSH_FXF_BLOCK_* values
	ULockMast uint32
}

Block SSH_FXP_BLOCK

func (*Block) UnmarshalBinary

func (p *Block) UnmarshalBinary(data []byte) error

type Close

type Close struct {
	Handle string
}

Close SSH_FXP_CLOSE C->S

func (*Close) UnmarshalBinary

func (p *Close) UnmarshalBinary(data []byte) error

type Data

type Data struct {
	Data string
	EOF  bool
}

Data SSH_FXP_DATA S->C

func (*Data) UnmarshalBinary

func (p *Data) UnmarshalBinary(data []byte) error

type Extended

type Extended struct {
	ExtendedRequest string
	ExtensionData   []byte
}

Extended SSH_FXP_EXTENDED

func (*Extended) UnmarshalBinary

func (p *Extended) UnmarshalBinary(data []byte) error

type ExtendedReply

type ExtendedReply struct {
	ExtensionData []byte
}

ExtendedReply SSH_FXP_EXTENDED_REPLY

func (*ExtendedReply) UnmarshalBinary

func (p *ExtendedReply) UnmarshalBinary(data []byte) error

type FSetStat

type FSetStat struct {
	Handle string
	Attrs  FileAttributes
}

FSetStat SSH_FXP_FSETSTAT C->S

func (*FSetStat) UnmarshalBinary

func (p *FSetStat) UnmarshalBinary(data []byte) error

type FStat

type FStat struct {
	Handle string
	Flags  uint32
}

FStat SSH_FXP_FSTAT C->S

func (*FStat) UnmarshalBinary

func (p *FStat) UnmarshalBinary(data []byte) error

type FileAttributes

type FileAttributes struct {
	Owner              string
	UntranslatedName   string
	MimeType           string
	ACL                string
	Group              string
	ExtendedData       []string
	ExtendedType       []string
	Size               uint64
	AllocationSize     uint64
	Atime              int64
	CreateTime         int64
	CTime              int64
	MTime              int64
	Permissions        uint32
	MTimeNSeconds      uint32
	CTimeNSeconds      uint32
	CreateTimeNSeconds uint32
	AttribBits         uint32
	AttribBitsValid    uint32
	AtimeNSeconds      uint32
	LinkCount          uint32
	Flags              uint32
	ExtendedCount      uint32
	TextHint           byte
	// contains filtered or unexported fields
}

FileAttributes https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13#section-7

func (*FileAttributes) UnmarshalBinary

func (fa *FileAttributes) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type Handle

type Handle struct {
	Handle string
}

Handle SSH_FXP_HANDLE S->C

func (*Handle) UnmarshalBinary

func (p *Handle) UnmarshalBinary(data []byte) error

type Init

type Init struct {
	Version uint32
}

Init SSH_FXP_INIT C->S

func (*Init) UnmarshalBinary

func (p *Init) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type LStat

type LStat struct {
	Path  string // UTF-8
	Flags uint32
}

LStat or SSH_FXP_LSTAT

func (*LStat) UnmarshalBinary

func (p *LStat) UnmarshalBinary(data []byte) error
type Link struct {
	NewLinkPath      string // UTF-8
	ExistingLinkPath string // UTF-8
	SymLink          bool
}

Link SSH_FXP_LINK C->S

func (*Link) UnmarshalBinary

func (p *Link) UnmarshalBinary(data []byte) error

type Mkdir

type Mkdir struct {
	Path  string
	Attrs FileAttributes
}

Mkdir SSH_FXP_MKDIR C->S

func (*Mkdir) UnmarshalBinary

func (p *Mkdir) UnmarshalBinary(data []byte) error

type Name

type Name struct {
	Filename []string // Count times
	Attrs    []byte   // Count times, Todo Attrs structure
	Count    uint32
	EOL      bool // Optional
}

Name SSH_FXP_NAME S->C

func (*Name) UnmarshalBinary

func (p *Name) UnmarshalBinary(data []byte) error

type Open

type Open struct {
	Filename      string // UTF-8
	Attrs         FileAttributes
	Flags         uint32
	DesiredAccess uint32
}

Open SSH_FXP_OPEN C->S

func (*Open) UnmarshalBinary

func (p *Open) UnmarshalBinary(data []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface

type OpenDir

type OpenDir struct {
	Path string
}

OpenDir SSH_FXP_OPENDIR

func (*OpenDir) UnmarshalBinary

func (p *OpenDir) UnmarshalBinary(data []byte) error

type Parser

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

Parser can parse SFTP client messages

func NewParser

func NewParser(buf []byte, logger zerolog.Logger) Parser

NewParser creates a new SFTP server.

func (*Parser) Parse

func (s *Parser) Parse() error

Parse parses the data provided

type Read

type Read struct {
	Handle string
	Offset uint64
	Length uint32
}

Read SSH_FXP_READ C->S

func (*Read) UnmarshalBinary

func (p *Read) UnmarshalBinary(data []byte) error

type ReadDir

type ReadDir struct {
	Handle string
}

ReadDir SSH_FXP_READDIR C->S

func (*ReadDir) UnmarshalBinary

func (p *ReadDir) UnmarshalBinary(data []byte) error
type ReadLink struct {
	Path string // UTF-8
}

ReadLink SSH_FXP_READLINK C->S

func (*ReadLink) UnmarshalBinary

func (p *ReadLink) UnmarshalBinary(data []byte) error

type RealPath

type RealPath struct {
	OriginalPath string   // UTF-8
	ComposePath  []string // optional
	ControlByte  byte     // optional
}

RealPath SSH_FXP_REALPATH C->S

func (*RealPath) UnmarshalBinary

func (p *RealPath) UnmarshalBinary(data []byte) error

type Remove

type Remove struct {
	Filename string // UTF-8
}

Remove SSH_FXP_REMOVE C->S

func (*Remove) UnmarshalBinary

func (p *Remove) UnmarshalBinary(data []byte) error

type Rename

type Rename struct {
	OldPath string // UTF-8
	NewPath string // UTF-8
	Flags   uint32
}

Rename SSH_FXP_RENAME C->S

func (*Rename) UnmarshalBinary

func (p *Rename) UnmarshalBinary(data []byte) error

type Rmdir

type Rmdir struct {
	Path string // UTF-8
}

Rmdir SSH_FXP_RMDIR C->S

func (*Rmdir) UnmarshalBinary

func (p *Rmdir) UnmarshalBinary(data []byte) error

type SetStat

type SetStat struct {
	Path  string // UTF-8
	Attrs FileAttributes
}

SetStat SSH_FXP_SETSTAT C->S

func (*SetStat) UnmarshalBinary

func (p *SetStat) UnmarshalBinary(data []byte) error

type Stat

type Stat struct {
	Path  string // UTF-8
	Flags uint32
}

Stat SSH_FXP_STAT

func (*Stat) UnmarshalBinary

func (p *Stat) UnmarshalBinary(data []byte) error

type Status

type Status struct {
	Message   string // ISO-10646 UTF-8 [RFC-2279]
	LangTag   string // RFC-1766
	ErrorCode uint32
}

Status SSH_FXP_STATUS S->C

func (*Status) UnmarshalBinary

func (p *Status) UnmarshalBinary(data []byte) error

type Unblock

type Unblock struct {
	// Handle is returned by SSH_FXP_OPEN
	Handle string
	// Offset is the beginning of the byte-range to unlock
	Offset uint64
	// Number  of bytes to unlock
	Length uint64
}

Unblock SSH_FXP_UNBLOCK

func (*Unblock) UnmarshalBinary

func (p *Unblock) UnmarshalBinary(data []byte) error

type Version

type Version struct {
	ExtensionPair [][]byte
	Version       uint32
}

Version SSH_FXP_VERSION S->C

type Write

type Write struct {
	Handle string
	Data   string
	Offset uint64
}

Write SSH_FXP_WRITE C->S

func (*Write) UnmarshalBinary

func (p *Write) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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