ssh

package
v0.0.0-...-e8be5e5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 12 Imported by: 0

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

Boot initializes the SSH provider. No additional startup logic required.

Boot 初始化 SSH provider。 无需额外启动逻辑。

func (*Provider) IsDefer

func (p *Provider) IsDefer() bool

IsDefer indicates SSH provider should defer loading. SSH connections are typically established on-demand.

IsDefer 表示 SSH provider 应延迟加载。 SSH 连接通常按需建立。

func (*Provider) Name

func (p *Provider) Name() string

Name returns provider name for identification.

Name 返回 provider 名称,用于标识。

func (*Provider) Provides

func (p *Provider) Provides() []string

Provides returns the capability keys this provider exposes. Exposes SSHKey for SSH service.

Provides 返回 provider 暴露的能力键。 暴露 SSHKey 用于 SSH 服务。

func (*Provider) Register

func (p *Provider) Register(c runtimecontract.Container) error

Register binds the SSH service factory to the container. Core logic: Create Service instance, bind to container.

Register 将 SSH 服务工厂绑定到容器。 核心逻辑:创建 Service 实例、绑定到容器。

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 服务,携带容器引用。 核心逻辑:初始化空的客户端缓存。

func (*Service) Client

func (s *Service) Client(hostName string) (integrationcontract.SSHClient, error)

Client returns SSH client for specified host name. Core logic: Check cache, dial if not cached, store in cache.

Client 返回指定主机名的 SSH 客户端。 核心逻辑:检查缓存、若未缓存则拨号、存入缓存。

Jump to

Keyboard shortcuts

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