Scert/backend/internal/deployment/client.go
xuans 7264149f9c 彻底移除 SSH 公钥部署路径
删除远程 authorized_keys 写入、PubkeyAuthentication 配置及客户端公钥部署接口,服务器部署仅保留 SSH 密码认证。
2026-10-02 04:09:14 +08:00

31 lines
973 B
Go

package deployment
import "context"
type CommandResult struct {
Output []byte
ExitCode int
}
type Client interface {
Lock(ctx context.Context, path string) error
Unlock(ctx context.Context, path string) error
MkdirAll(ctx context.Context, path string) error
List(ctx context.Context, path string) ([]string, error)
Exists(ctx context.Context, path string) (bool, error)
Upload(ctx context.Context, path string, data []byte, mode uint32) error
Rename(ctx context.Context, source, target string) error
Remove(ctx context.Context, path string) error
Run(ctx context.Context, command []string) (CommandResult, error)
Close() error
}
type ClientFactory interface {
Connect(ctx context.Context, server Server) (Client, error)
}
// ShellClientFactory 为只需要 SSH Shell 的操作提供连接入口,避免无关的 SFTP 子系统阻塞密钥部署。
type ShellClientFactory interface {
ConnectShell(ctx context.Context, server Server) (Client, error)
}