targetparse

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package targetparse 提供纯无状态的 SSH 目标字符串解析与 CLI ProxyJump 上游选项投影(INV-D3), 供 core/internal/usecase/inventory 在目标解析与多跳跳板展开中复用。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCLIJumpAuthFallback

func ExtractCLIJumpAuthFallback(cli option.OptionLayer) option.OptionLayer

ExtractCLIJumpAuthFallback 仅提取供临时 AdHoc ProxyJump 跳板兜底复用的 CLI 密钥认证项, 避免覆盖 OpenSSH 虚拟跳板在 ~/.ssh/config 中显式绑定的 IdentityFile/CertificateFile/IdentitiesOnly。

func ExtractCLIJumpPolicy

func ExtractCLIJumpPolicy(cli option.OptionLayer) option.OptionLayer

ExtractCLIJumpPolicy 提取依 INV-D3 须对全部 ProxyJump 上游跳板(含虚拟与临时跳板)生效的 CLI 安全、非交互、信任库与传输算法覆写,绝不污染目标专用 HostName/Port/User/Proxy/Forward/Session/LocalCommand。

Types

type ParsedTarget

type ParsedTarget struct {
	User     algebraic.Option[option.Username]
	OrigHost option.OriginalHostSpec
	Port     algebraic.Option[uint16]
}

ParsedTarget 保存解析 [user@]host[:port] 或 OpenSSH 别名后得到的强类型原始目标要素。

func ParseHopSpec

func ParseHopSpec(h option.HopTarget, invalidErr error) (pt ParsedTarget, err error)

ParseHopSpec 将已校验的 option.HopTarget 转换为统一的 ParsedTarget 供递归跳板解析复用。

func ParseSpec

func ParseSpec(raw string, invalidErr error) (ParsedTarget, error)

ParseSpec 解析用户传入的目标字符串(支持 [user@]host[:port]、[ipv6][:port]、裸 IPv6 与 OpenSSH 别名), 严格拒绝空串、空白、控制/格式字符、多个 '@' 与前导零/越界端口。

func (ParsedTarget) InlineLayer

func (p ParsedTarget) InlineLayer() option.OptionLayer

InlineLayer 将解析得到的行内用户名与端口投影为最高优先级 OptionLayer。

Jump to

Keyboard shortcuts

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