Documentation
¶
Overview ¶
Package ssh provides SSH service for gorp framework. Supports remote command execution through SSH connections. Configurable hosts, authentication (password/key), and known_hosts verification.
SSH 包提供 SSH 服务,用于 gorp 框架。 支持通过 SSH 连接执行远程命令。 可配置主机、认证(密码/密钥)、known_hosts 验证。
Package ssh provides SSH service implementation. Manages SSH connections with configurable authentication. Supports password and key-based authentication with known_hosts verification.
SSH 包提供 SSH 服务实现。 管理带可配置认证的 SSH 连接。 支持密码和密钥认证,带 known_hosts 验证。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct{}
Provider registers SSH service. Core logic: Bind SSH service factory to container.
Provider 注册 SSH 服务。 核心逻辑:将 SSH 服务工厂绑定到容器。
func NewProvider ¶
func NewProvider() *Provider
NewProvider creates a new SSH provider.
NewProvider 创建新的 SSH provider。
func (*Provider) Boot ¶
func (p *Provider) Boot(runtimecontract.Container) error
Boot initializes the SSH provider. No additional startup logic required.
Boot 初始化 SSH provider。 无需额外启动逻辑。
func (*Provider) IsDefer ¶
IsDefer indicates SSH provider should defer loading. SSH connections are typically established on-demand.
IsDefer 表示 SSH provider 应延迟加载。 SSH 连接通常按需建立。
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages SSH connections to multiple hosts. Core logic: Cache connections, dial on demand, handle authentication.
Service 管理到多主机的 SSH 连接。 核心逻辑:缓存连接、按需拨号、处理认证。
func NewService ¶
func NewService(c runtimecontract.Container) (*Service, error)
NewService creates a new SSH service with container reference. Core logic: Initialize empty client cache.
NewService 创建新的 SSH 服务,携带容器引用。 核心逻辑:初始化空的客户端缓存。