Documentation
¶
Overview ¶
Package sshsftp contains the shared SSH session and SFTP route implementation.
Index ¶
- Constants
- func Connect(ctx context.Context, cfg plugin.ConnectConfig) (plugin.Session, error)
- func CredentialKinds() []plugin.CredentialKindInfo
- func Routes(prefix, protocol string, includeShell bool) []plugin.Route
- type FileContent
- type FileEntry
- type FilePage
- type Session
- func (s *Session) Close() error
- func (s *Session) Filesystem() (*sftp.Client, error)
- func (s *Session) HealthCheck(context.Context) error
- func (s *Session) OpenChannel(ctx context.Context, req plugin.ChannelRequest) (plugin.Channel, error)
- func (s *Session) RunCommand(ctx context.Context, command string) (string, bool, error)
Constants ¶
View Source
const ( CredentialSSHPrivateKey plugin.CredentialKind = "ssh_private_key" CredentialSSHPassword plugin.CredentialKind = "ssh_password" )
Variables ¶
This section is empty.
Functions ¶
func CredentialKinds ¶
func CredentialKinds() []plugin.CredentialKindInfo
Types ¶
type FileContent ¶
type FileContent struct {
Path string `json:"path"`
MIME string `json:"mime,omitempty"`
Encoding string `json:"encoding,omitempty"`
Content string `json:"content,omitempty"`
URL string `json:"url,omitempty"`
Size int64 `json:"size,omitempty"`
Truncated bool `json:"truncated,omitempty"`
}
FileContent is the generic file_browser preview payload.
type FileEntry ¶
type FileEntry struct {
Name string `json:"name"`
Path string `json:"path"`
IsDir bool `json:"isDir"`
Size int64 `json:"size,omitempty"`
MIME string `json:"mime,omitempty"`
ModTime time.Time `json:"modTime,omitzero"`
Mode string `json:"mode,omitempty"`
Symlink string `json:"symlink,omitempty"`
}
FileEntry is the generic file_browser listing row.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds all mutable per-connection SSH state.
func NewSession ¶
NewSession wraps an authenticated SSH client.
func (*Session) Filesystem ¶
Filesystem opens SFTP lazily over the existing SSH client.
func (*Session) OpenChannel ¶
Click to show internal directories.
Click to hide internal directories.