Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
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 ¶
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) ListenAndServe ¶ added in v0.16.0
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.