sftpops

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name    string
	Size    int64
	Mode    fs.FileMode
	ModTime time.Time
	IsDir   bool
}

Entry is a single directory listing entry.

type Ops

type Ops interface {
	Read(ctx context.Context, host, path string, maxBytes int) (data []byte, isBinary bool, err error)
	Write(ctx context.Context, host, path string, content []byte, mode fs.FileMode) error
	List(ctx context.Context, host, path string) ([]Entry, error)
}

Ops is the interface for SFTP file operations against pre-declared hosts.

func New

func New(cfg *config.Config, pool interface {
	Get(context.Context, string) (*ssh.Client, func(), error)
}) Ops

New returns an Ops backed by the given pool.

Jump to

Keyboard shortcuts

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