app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package app 实现 hosts/exec/get/put 子命令业务(对齐 Spec §4)。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Doctor

func Doctor(c *Config, host string) response.Envelope

Doctor 对指定 Host 做非破坏性诊断(不读 IdentityFile、不回显密钥)。

func Exec

func Exec(c *Config, host string, commandParts []string) response.Envelope

Exec 远程执行命令。

func Get

func Get(c *Config, host, remotePath, localPath string) response.Envelope

Get 下载远程文件。

func Hosts

func Hosts(c *Config) response.Envelope

Hosts 列出 Host 别名及其寻址字段(User/HostName/Port/ProxyJump,不探测网络)。

func Put

func Put(c *Config, host, localPath, remotePath string) response.Envelope

Put 上传本地文件到白名单路径。

func ShowPolicy

func ShowPolicy(c *Config) response.Envelope

ShowPolicy 返回当前生效策略快照(不回显密钥;denylist 为完整 pattern 列表)。

Types

type Config

type Config struct {
	SSHConfig  string
	PolicyPath string
	Timeout    time.Duration // 0 表示用 policy
	Workdir    string
	Policy     *policy.Policy
}

Config 一次 CLI 调用的全局选项。

func (*Config) LoadPolicy

func (c *Config) LoadPolicy() error

LoadPolicy 加载策略到 cfg。

Jump to

Keyboard shortcuts

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