Documentation
¶
Index ¶
- func NewFS(fs fs.FS, callback NotificationHandler) fs.FS
- func WithAddress(val string) func(server *Server)
- func WithBasePath(path string) func(server *Server)
- func WithCredentialValidator(...) func(server *Server)
- func WithNotificationCallback(callback NotificationHandler) func(srv *Server)
- func WithPort(val int) func(server *Server)
- func WithPrivateKey(val string) func(server *Server)
- func WithPublicKey(val string) func(server *Server)
- func WithSSHPath(val string) func(server *Server)
- func WithUserProvider(provider interfaces2.UserProvider) func(*Server)
- type FS
- func (f *FS) Conn() *ssh.ServerConn
- func (f *FS) Context() map[string]string
- func (f *FS) Filecmd(request *sftp.Request) error
- func (f *FS) Filelist(request *sftp.Request) (sftp.ListerAt, error)
- func (f *FS) Fileread(request *sftp.Request) (io.ReaderAt, error)
- func (f *FS) Filewrite(request *sftp.Request) (io.WriterAt, error)
- func (f *FS) Logger() log.Logger
- func (f *FS) Notify(request *sftp.Request, err error)
- func (f *FS) Permissions() []string
- func (f *FS) SetConn(sconn *ssh.ServerConn)
- func (f *FS) SetContext(ctx map[string]string)
- func (f *FS) SetID(p string)
- func (f *FS) SetLogger(logger log.Logger)
- func (f *FS) SetPermissions(p []string)
- func (f *FS) Type() string
- type Notification
- type NotificationHandler
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAddress ¶
func WithBasePath ¶
func WithCredentialValidator ¶
func WithCredentialValidator(val func(server *Server, r fs.AuthenticationRequest) (*fs.AuthenticationResponse, error)) func(server *Server)
func WithNotificationCallback ¶
func WithNotificationCallback(callback NotificationHandler) func(srv *Server)
func WithPrivateKey ¶
func WithPublicKey ¶
func WithSSHPath ¶
func WithUserProvider ¶
func WithUserProvider(provider interfaces2.UserProvider) func(*Server)
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
func (*FS) Conn ¶
func (f *FS) Conn() *ssh.ServerConn
func (*FS) Permissions ¶
func (*FS) SetConn ¶
func (f *FS) SetConn(sconn *ssh.ServerConn)
func (*FS) SetContext ¶
func (*FS) SetPermissions ¶
type Notification ¶
type Notification struct { User string `json:"user"` FsType string `json:"fs_type"` ClientVersion string `json:"client_version"` RemoteAddr string `json:"remote_addr"` Time time.Time `json:"time"` Event string `json:"event"` Subject string `json:"subject"` Target string `json:"target"` Error error `json:"error"` }
type NotificationHandler ¶
type NotificationHandler func(notification Notification) error
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewWithNotify ¶
func (*Server) AcceptInboundConnection ¶
func (c *Server) AcceptInboundConnection(conn net.Conn, config *ssh.ServerConfig)
AcceptInboundConnection ... Handles an inbound connection to the instance and determines if we should serve the request or not.
func (*Server) Initialize ¶
Initialize the SFTP server and add a persistent listener to handle inbound SFTP connections.
func (*Server) Validate ¶
func (c *Server) Validate(conn ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error)
Click to show internal directories.
Click to hide internal directories.