models

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	Alias   []string `yaml:"alias,omitempty"`
	Address string   `yaml:"address"` // IP 或 域名
	Port    uint16   `yaml:"port"`
}

Host 定义网络连接信息

type Identity

type Identity struct {
	User       string `yaml:"user"`
	KeyPath    string `yaml:"key_path,omitempty"`
	Passphrase string `yaml:"passphrase,omitempty"` // 私钥密码
	Password   string `yaml:"password,omitempty"`   // 登录密码
	AuthType   string `yaml:"auth_type"`            // "key", "password", "agent"
}

Identity 定义认证信息

type Node

type Node struct {
	Alias []string `yaml:"alias,omitempty"`
	Tags  []string `yaml:"tags,omitempty"` // 用于分组

	// 引用解耦
	HostRef     string `yaml:"host_ref"`
	IdentityRef string `yaml:"identity_ref"`

	// 高级网络配置
	ProxyJump string `yaml:"proxy_jump,omitempty"` // 指向另一个 Node 的 Name

	// 提权配置
	SudoMode string `yaml:"sudo_mode"` // "none", "sudo", "sudoer", "su", "root"(已是root), "auto"(自动探测)
	SuPwd    string `yaml:"su_pwd,omitempty"`
}

Node 是用户操作的最小单元,聚合了 Host 和 Identity

type NodeFilter

type NodeFilter struct {
	Names []string // 精确匹配 Name
	Tags  []string // 包含任意 Tag 即匹配
}

NodeFilter 用于批量操作时筛选节点

Jump to

Keyboard shortcuts

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