Documentation
¶
Overview ¶
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
Index ¶
- func Execute() (err error)
- func NewCmdCredential() *cobra.Command
- func NewCmdExec() *cobra.Command
- func NewCmdIdentity() *cobra.Command
- func NewCmdIdentityAdd() *cobra.Command
- func NewCmdIdentityCredential() *cobra.Command
- func NewCmdIdentityDelete() *cobra.Command
- func NewCmdIdentityEdit() *cobra.Command
- func NewCmdIdentityList() *cobra.Command
- func NewCmdInit() *cobra.Command
- func NewCmdMcp() *cobra.Command
- func NewCmdPlay() *cobra.Command
- func NewCmdScp() *cobra.Command
- func NewCmdSftp() *cobra.Command
- func NewCmdSsh() *cobra.Command
- func NewCmdTui() *cobra.Command
- type DoctorCheckItem
- type ExecOptions
- type FirewallOptions
- type InitOptions
- type PathInfo
- type PlayOptions
- type ScpOptions
- type SftpOptions
- type SshOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCmdCredential ¶ added in v0.12.0
NewCmdCredential 创建凭据管理根命令
func NewCmdExec ¶
func NewCmdIdentity ¶
func NewCmdIdentityAdd ¶
func NewCmdIdentityCredential ¶ added in v0.12.0
NewCmdIdentityCredential 创建 identity credential 子命令
func NewCmdIdentityDelete ¶
func NewCmdIdentityEdit ¶
func NewCmdIdentityList ¶
func NewCmdInit ¶ added in v0.11.0
NewCmdInit creates the command that initializes local XOps configuration.
func NewCmdPlay ¶ added in v0.9.0
func NewCmdSftp ¶
Types ¶
type DoctorCheckItem ¶ added in v0.12.0
DoctorCheckItem 表示单项检查结果
type ExecOptions ¶
type ExecOptions struct {
SshOptions
HostFile string
ShellFile string
Command string
Tag string
Exclude []string
TaskCount int
SuPwd string
Interactive bool
NoLoginShell bool
Stream bool
OutDir string
// contains filtered or unexported fields
}
func NewExecOptions ¶
func NewExecOptions() *ExecOptions
func (*ExecOptions) Complete ¶
func (o *ExecOptions) Complete(cmd *cobra.Command, args []string) error
func (*ExecOptions) Run ¶
func (o *ExecOptions) Run() error
func (*ExecOptions) RunContext ¶ added in v0.12.0
func (o *ExecOptions) RunContext(ctx context.Context) (retErr error)
RunContext executes the command on all selected hosts and propagates caller cancellation.
func (*ExecOptions) Validate ¶
func (o *ExecOptions) Validate() error
type FirewallOptions ¶
type FirewallOptions struct {
SshOptions
HostFile string
Protocol string
Reload bool
Remove bool
Zone string
Action firewall.Action
TaskCount int
StatusOnly bool
Exclude []string
}
func NewFirewallOptions ¶
func NewFirewallOptions() *FirewallOptions
func (*FirewallOptions) RunOnHosts ¶
type InitOptions ¶ added in v0.11.0
type InitOptions struct {
ConfigPath string
KeyPath string
SSHConfigPath string
SSHConfigChanged bool
SkipSSHImport bool
}
InitOptions contains the filesystem-only settings for xops init.
func NewInitOptions ¶ added in v0.11.0
func NewInitOptions() *InitOptions
NewInitOptions creates initialization options with the default OpenSSH path.
func (*InitOptions) Run ¶ added in v0.11.0
func (o *InitOptions) Run() (initResult, error)
Run creates the local configuration and imports concrete OpenSSH hosts. It never performs network operations and never overwrites existing nodes.
func (*InitOptions) RunContext ¶ added in v0.12.0
func (o *InitOptions) RunContext(ctx context.Context) (initResult, error)
RunContext creates local configuration while preserving caller cancellation through durable configuration writes.
type PlayOptions ¶ added in v0.9.0
type PlayOptions struct {
FilePath string
Vars []string // 格式: "key=value"
Concurrency uint
DryRun bool
Limit string // 逗号分隔的节点名称,覆盖 Playbook 的 targets
Sudo bool
Out io.Writer
}
PlayOptions 保存 xops play 命令的所有选项
func NewPlayOptions ¶ added in v0.9.0
func NewPlayOptions() *PlayOptions
func (*PlayOptions) RunContext ¶ added in v0.12.0
func (o *PlayOptions) RunContext(ctx context.Context) (retErr error)
RunContext executes the Playbook and propagates caller cancellation through target resolution, SSH connections, and step execution.
type ScpOptions ¶
type ScpOptions struct {
SshOptions
Recursive bool
Progress bool
Force bool
NoOverwrite bool
TaskCount int
ThreadCount int
Source string
Dest string
HostFile string
Tag string
Exclude []string
}
func NewScpOptions ¶
func NewScpOptions() *ScpOptions
func (*ScpOptions) Run ¶
func (o *ScpOptions) Run() error
func (*ScpOptions) RunContext ¶ added in v0.12.0
func (o *ScpOptions) RunContext(ctx context.Context) (retErr error)
func (*ScpOptions) Validate ¶
func (o *ScpOptions) Validate() error
type SftpOptions ¶
type SftpOptions struct {
SshOptions
// contains filtered or unexported fields
}
func NewSftpOptions ¶
func NewSftpOptions() *SftpOptions
func (*SftpOptions) Run ¶
func (o *SftpOptions) Run() error
func (*SftpOptions) RunContext ¶ added in v0.12.0
func (o *SftpOptions) RunContext(ctx context.Context) (err error)
RunContext starts the interactive SFTP session and propagates caller cancellation.
type SshOptions ¶
type SshOptions struct {
Host string
Port uint16
User string
Password string
PasswordStdin bool
IdentityFile string
Passphrase string
PassphraseStdin bool
Remember string
Sudo bool
Alias string
JumpHost string
Tags []string
LocalForwards []string
RemoteForwards []string
NoCmd bool
DynamicForward string
BgRun bool
StdinRedirect bool
Target config.ConnectionTarget
Command string
// contains filtered or unexported fields
}
func NewSshOptions ¶
func NewSshOptions() *SshOptions
func (*SshOptions) Complete ¶
func (o *SshOptions) Complete(cmd *cobra.Command, args []string) error
func (*SshOptions) Run ¶
func (o *SshOptions) Run() error
func (*SshOptions) RunContext ¶ added in v0.12.0
func (o *SshOptions) RunContext(ctx context.Context) (err error)
RunContext starts the SSH operation and propagates caller cancellation.
func (*SshOptions) Validate ¶
func (o *SshOptions) Validate() error