sftp

package
v0.30.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.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 Mount added in v0.30.0

type Mount struct {
	Source string
	Target string
}

type RequestServer added in v0.16.0

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

func NewRequestServer added in v0.16.0

func NewRequestServer(session io.ReadWriteCloser, root *os.Root, mounts ...rootMount) *RequestServer

func (*RequestServer) Close added in v0.16.0

func (s *RequestServer) Close() error

func (*RequestServer) Serve added in v0.16.0

func (s *RequestServer) Serve() error

type Server

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

func NewServer added in v0.16.0

func NewServer(addr, root string, mounts ...Mount) (*Server, error)

NewServer serves root at the SFTP top level, with each mount overlaid at its target path. An empty root creates a mounts-only server: paths outside the mounts report fs.ErrNotExist.

func (*Server) Close

func (s *Server) Close() error

Close releases the root directories. In-flight handlers that touch a root after Close will see fs.ErrClosed on their next operation and unwind on their own; Close does not wait for them to do so, which avoids parking shutdown on a long-lived sshfs client. The listener used by Serve is owned by the caller; close it separately to stop the accept loop.

func (*Server) HandleConn added in v0.18.0

func (s *Server) HandleConn(c net.Conn) error

func (*Server) ListenAndServe added in v0.16.0

func (s *Server) ListenAndServe() error

ListenAndServe binds the address passed to NewServer and serves on it. Callers that need synchronous bind-error handling should call net.Listen themselves and pass the listener to Serve.

func (*Server) Serve

func (s *Server) Serve(l net.Listener) error

Serve accepts connections on the supplied listener until it is closed. The caller owns l and is responsible for closing it.

Jump to

Keyboard shortcuts

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