sftpsrv

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompatAlgorithms

func CompatAlgorithms() (kex, ciphers, macs []string)

CompatAlgorithms 返回启用的兼容算法集(各返回副本),供 Web 页展示与核对。

Types

type Server

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

Server SFTP 服务端:ssh 监听 + sftp RequestServer,文件系统囚笼在 vfs.root。

func New

func New(v *vfs.VFS, a *auth.Store, port int, signers ...ssh.Signer) *Server

New 构造 SFTP 服务端。port 为 0 时使用随机端口(便于测试)。 signers 为主机密钥列表,通常传入 ed25519 与 RSA 各一把以最大化设备兼容性。

func (*Server) Addr

func (s *Server) Addr() string

Addr 返回本机可连接地址。

func (*Server) Start

func (s *Server) Start() error

Start 开始监听并接受连接。

func (*Server) Status

func (s *Server) Status() Status

Status 返回当前状态。

func (*Server) Stop

func (s *Server) Stop() error

Stop 停止监听。

type Status

type Status struct {
	Running bool
	Port    int
	Err     string
}

Status 表示 SFTP 服务端的运行状态。

Jump to

Keyboard shortcuts

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