Documentation
¶
Overview ¶
Package optval 提供 core/domain/option 拆分的不可变 OpenSSH 转发、多路复用与认证/会话领域值对象子包。
本包为公开只读叶包,恪守 core/domain/** 纯数学零副作用铁律(零 os/net/context/sync/reflect), 全部导出类型、常量、哨兵错误与构造器均由父包 core/domain/option 通过零开销类型别名与薄转发函数完整重导出。
Index ¶
- Constants
- Variables
- func ExpandLocalCommandRaw(raw string, ctx TokenContext, lookupEnv func(string) (string, bool)) ([]string, error)
- func ExpandProxyCommandRaw(raw string, ctx TokenContext, lookupEnv func(string) (string, bool)) ([]string, error)
- type CommandTemplate
- func (c CommandTemplate) Expand(ctx TokenContext, lookupEnv func(string) (string, bool)) ([]string, error)
- func (c CommandTemplate) ExpandExecutable(ctx TokenContext, lookupEnv func(string) (string, bool)) (string, error)
- func (c CommandTemplate) IsLocal() bool
- func (c CommandTemplate) IsValid() bool
- func (c CommandTemplate) IsZero() bool
- func (c CommandTemplate) TokenCount() int
- type ControlMasterMode
- type ControlPathKind
- type ControlPathSpec
- func (s ControlPathSpec) Equal(o ControlPathSpec) bool
- func (s ControlPathSpec) IsDisabled() bool
- func (s ControlPathSpec) IsEnabled() bool
- func (s ControlPathSpec) IsLiteral() bool
- func (s ControlPathSpec) IsUnset() bool
- func (s ControlPathSpec) Kind() ControlPathKind
- func (s ControlPathSpec) String() string
- type ControlPersistKind
- type ControlPersistSpec
- func (p ControlPersistSpec) AppendText(b []byte) ([]byte, error)
- func (p ControlPersistSpec) Equal(o ControlPersistSpec) bool
- func (p ControlPersistSpec) IsEnabled() bool
- func (p ControlPersistSpec) IsIndefinite() bool
- func (p ControlPersistSpec) IsUnset() bool
- func (p ControlPersistSpec) Kind() ControlPersistKind
- func (p ControlPersistSpec) MarshalText() ([]byte, error)
- func (p ControlPersistSpec) String() string
- func (p ControlPersistSpec) Timeout() (algebraic.Duration, bool)
- func (p *ControlPersistSpec) UnmarshalText(t []byte) error
- type ControlPolicy
- func (c ControlPolicy) Compose(lower ControlPolicy) ControlPolicy
- func (c ControlPolicy) EffectiveMaster() ControlMasterMode
- func (c ControlPolicy) EffectivePersist() ControlPersistSpec
- func (c ControlPolicy) Equal(o ControlPolicy) bool
- func (c ControlPolicy) IsDisabled() bool
- func (c ControlPolicy) IsEnabled() bool
- func (c ControlPolicy) IsUnset() bool
- func (c ControlPolicy) IsZero() bool
- func (c ControlPolicy) MarshalJSONTo(e *jsontext.Encoder) error
- func (c ControlPolicy) Master() ControlMasterMode
- func (c ControlPolicy) Path() ControlPathSpec
- func (c ControlPolicy) Persist() ControlPersistSpec
- func (c *ControlPolicy) UnmarshalJSONFrom(d *jsontext.Decoder) error
- func (c ControlPolicy) WithMaster(m ControlMasterMode) ControlPolicy
- func (c ControlPolicy) WithPath(p ControlPathSpec) ControlPolicy
- func (c ControlPolicy) WithPersist(p ControlPersistSpec) ControlPolicy
- type DynamicForwardList
- func (l DynamicForwardList) Clone() DynamicForwardList
- func (l DynamicForwardList) Compose(lo DynamicForwardList) DynamicForwardList
- func (l DynamicForwardList) Equal(o DynamicForwardList) bool
- func (d DynamicForwardList) IsUnset() bool
- func (l DynamicForwardList) IsValidAll() bool
- func (d DynamicForwardList) IsZero() bool
- func (d DynamicForwardList) Items() []T
- func (l DynamicForwardList) MarshalJSONTo(e *jsontext.Encoder) error
- func (d DynamicForwardList) RawItems() []string
- func (l *DynamicForwardList) UnmarshalJSONFrom(d *jsontext.Decoder) error
- type EnvAssignment
- type EnvFilter
- func (f EnvFilter) ClearPatterns() []string
- func (f EnvFilter) Clone() EnvFilter
- func (f EnvFilter) Compose(lower EnvFilter) EnvFilter
- func (f EnvFilter) Equal(o EnvFilter) bool
- func (f EnvFilter) Filter(env map[string]string) map[string]string
- func (f EnvFilter) FilterNames(names []string) []string
- func (f EnvFilter) FilterSorted(env map[string]string) []string
- func (f EnvFilter) IsUnset() bool
- func (f EnvFilter) IsZero() bool
- func (f EnvFilter) MarshalJSONTo(e *jsontext.Encoder) error
- func (f EnvFilter) Match(envName string) bool
- func (f EnvFilter) Patterns() []string
- func (f *EnvFilter) UnmarshalJSONFrom(d *jsontext.Decoder) error
- type EnvSet
- func (s EnvSet) Clone() EnvSet
- func (s EnvSet) Compose(lo EnvSet) EnvSet
- func (s EnvSet) Equal(o EnvSet) bool
- func (s EnvSet) IsUnset() bool
- func (s EnvSet) IsValidAll() bool
- func (s EnvSet) IsZero() bool
- func (s EnvSet) Items() []EnvAssignment
- func (s EnvSet) Map() map[string]string
- func (s EnvSet) MarshalJSONTo(e *jsontext.Encoder) error
- func (s *EnvSet) UnmarshalJSONFrom(d *jsontext.Decoder) error
- type EscapeCharKind
- type EscapeCharSpec
- func (e EscapeCharSpec) AppendText(b []byte) ([]byte, error)
- func (e EscapeCharSpec) Byte() (byte, bool)
- func (e EscapeCharSpec) Equal(o EscapeCharSpec) bool
- func (e EscapeCharSpec) IsDisabled() bool
- func (e EscapeCharSpec) IsEnabled() bool
- func (e EscapeCharSpec) IsValid() bool
- func (e EscapeCharSpec) IsZero() bool
- func (e EscapeCharSpec) Kind() EscapeCharKind
- func (e EscapeCharSpec) MarshalText() ([]byte, error)
- func (e EscapeCharSpec) String() string
- func (e *EscapeCharSpec) UnmarshalText(t []byte) error
- type ForwardAgentKind
- type ForwardAgentSpec
- func (f ForwardAgentSpec) AppendText(b []byte) ([]byte, error)
- func (f ForwardAgentSpec) EnvVarName() string
- func (f ForwardAgentSpec) Equal(o ForwardAgentSpec) bool
- func (f ForwardAgentSpec) IsCustomPath() bool
- func (f ForwardAgentSpec) IsDefault() bool
- func (f ForwardAgentSpec) IsDisabled() bool
- func (f ForwardAgentSpec) IsEnabled() bool
- func (f ForwardAgentSpec) IsEnvVar() bool
- func (f ForwardAgentSpec) IsValid() bool
- func (f ForwardAgentSpec) IsZero() bool
- func (f ForwardAgentSpec) Kind() ForwardAgentKind
- func (f ForwardAgentSpec) MarshalJSONTo(enc *jsontext.Encoder) error
- func (f ForwardAgentSpec) MarshalText() ([]byte, error)
- func (f ForwardAgentSpec) Path() string
- func (f ForwardAgentSpec) String() string
- func (f *ForwardAgentSpec) UnmarshalJSONFrom(dec *jsontext.Decoder) error
- func (f *ForwardAgentSpec) UnmarshalText(t []byte) error
- type ForwardEndpoint
- func (e ForwardEndpoint) AppendText(b []byte) ([]byte, error)
- func (e ForwardEndpoint) Equal(o ForwardEndpoint) bool
- func (e ForwardEndpoint) HasHost() bool
- func (e ForwardEndpoint) Host() string
- func (e ForwardEndpoint) IsUnix() bool
- func (e ForwardEndpoint) IsValid() bool
- func (e ForwardEndpoint) IsWildcard() bool
- func (e ForwardEndpoint) IsZero() bool
- func (e ForwardEndpoint) MarshalText() ([]byte, error)
- func (e ForwardEndpoint) Port() uint16
- func (e ForwardEndpoint) SocketPath() string
- func (e ForwardEndpoint) String() string
- func (e *ForwardEndpoint) UnmarshalText(t []byte) error
- type ForwardList
- func (l ForwardList) Clone() ForwardList
- func (l ForwardList) Compose(lo ForwardList) ForwardList
- func (l ForwardList) Equal(o ForwardList) bool
- func (d ForwardList) IsUnset() bool
- func (l ForwardList) IsValidLocal() bool
- func (l ForwardList) IsValidRemote() bool
- func (d ForwardList) IsZero() bool
- func (d ForwardList) Items() []T
- func (l ForwardList) MarshalJSONTo(e *jsontext.Encoder) error
- func (d ForwardList) RawItems() []string
- func (l *ForwardList) UnmarshalJSONFrom(d *jsontext.Decoder) error
- type ForwardSpec
- func (s ForwardSpec) AppendText(b []byte) ([]byte, error)
- func (s ForwardSpec) Bind() ForwardEndpoint
- func (s ForwardSpec) Dest() ForwardEndpoint
- func (s ForwardSpec) Equal(o ForwardSpec) bool
- func (s ForwardSpec) IsDynamic() bool
- func (s ForwardSpec) IsValid() bool
- func (s ForwardSpec) IsZero() bool
- func (s ForwardSpec) MarshalText() ([]byte, error)
- func (s ForwardSpec) String() string
- func (s *ForwardSpec) UnmarshalText(t []byte) error
- type IdentityAgentKind
- type IdentityAgentSpec
- func (a IdentityAgentSpec) AppendText(b []byte) ([]byte, error)
- func (a IdentityAgentSpec) EnvVarName() string
- func (a IdentityAgentSpec) Equal(o IdentityAgentSpec) bool
- func (a IdentityAgentSpec) IsDisabled() bool
- func (a IdentityAgentSpec) IsSSHAuthSock() bool
- func (a IdentityAgentSpec) IsValid() bool
- func (a IdentityAgentSpec) IsZero() bool
- func (a IdentityAgentSpec) Kind() IdentityAgentKind
- func (a IdentityAgentSpec) MarshalText() ([]byte, error)
- func (a IdentityAgentSpec) String() string
- func (a *IdentityAgentSpec) UnmarshalText(t []byte) error
- type PreferredAuthList
- func (p PreferredAuthList) AppendText(b []byte) ([]byte, error)
- func (p PreferredAuthList) Clone() PreferredAuthList
- func (p PreferredAuthList) Equal(o PreferredAuthList) bool
- func (p PreferredAuthList) IsValid() bool
- func (p PreferredAuthList) IsZero() bool
- func (p PreferredAuthList) MarshalText() ([]byte, error)
- func (p PreferredAuthList) Methods() []string
- func (p PreferredAuthList) String() string
- func (p *PreferredAuthList) UnmarshalText(t []byte) error
- type RemoteCommandKind
- type RemoteCommandSpec
- func (r RemoteCommandSpec) AppendText(b []byte) ([]byte, error)
- func (r RemoteCommandSpec) Equal(o RemoteCommandSpec) bool
- func (r RemoteCommandSpec) IsDisabled() bool
- func (r RemoteCommandSpec) IsEnabled() bool
- func (r RemoteCommandSpec) IsValid() bool
- func (r RemoteCommandSpec) IsZero() bool
- func (r RemoteCommandSpec) Kind() RemoteCommandKind
- func (r RemoteCommandSpec) MarshalText() ([]byte, error)
- func (r RemoteCommandSpec) String() string
- func (r *RemoteCommandSpec) UnmarshalText(t []byte) error
- type StreamLocalBindMask
- func (m StreamLocalBindMask) AppendText(b []byte) ([]byte, error)
- func (m StreamLocalBindMask) Equal(o StreamLocalBindMask) bool
- func (m StreamLocalBindMask) IsValid() bool
- func (m StreamLocalBindMask) IsZero() bool
- func (m StreamLocalBindMask) MarshalText() ([]byte, error)
- func (m StreamLocalBindMask) String() string
- func (m *StreamLocalBindMask) UnmarshalText(t []byte) error
- func (m StreamLocalBindMask) Value() uint32
- type TokenContext
- type TunnelDeviceSpec
- func (d TunnelDeviceSpec) AppendText(b []byte) ([]byte, error)
- func (d TunnelDeviceSpec) Equal(o TunnelDeviceSpec) bool
- func (d TunnelDeviceSpec) IsValid() bool
- func (d TunnelDeviceSpec) IsZero() bool
- func (d TunnelDeviceSpec) LocalUnit() uint32
- func (d TunnelDeviceSpec) MarshalText() ([]byte, error)
- func (d TunnelDeviceSpec) RemoteUnit() uint32
- func (d TunnelDeviceSpec) String() string
- func (d *TunnelDeviceSpec) UnmarshalText(t []byte) error
Constants ¶
const ( IdentityAgentUnset IdentityAgentKind = IdentityAgentKind(optparse.IdentityAgentUnset) IdentityAgentDisabled IdentityAgentKind = IdentityAgentKind(optparse.IdentityAgentDisabled) IdentityAgentSSHAuthSock IdentityAgentKind = IdentityAgentKind(optparse.IdentityAgentSSHAuthSock) IdentityAgentEnvVar IdentityAgentKind = IdentityAgentKind(optparse.IdentityAgentEnvVar) IdentityAgentPath IdentityAgentKind = IdentityAgentKind(optparse.IdentityAgentPath) EscapeCharUnset EscapeCharKind = EscapeCharKind(optparse.EscapeCharUnset) EscapeCharDisabled EscapeCharKind = EscapeCharKind(optparse.EscapeCharDisabled) EscapeCharByte EscapeCharKind = EscapeCharKind(optparse.EscapeCharByte) RemoteCommandUnset RemoteCommandKind = RemoteCommandKind(optparse.RemoteCmdUnset) RemoteCommandDisabled RemoteCommandKind = RemoteCommandKind(optparse.RemoteCmdDisabled) RemoteCommandSet RemoteCommandKind = RemoteCommandKind(optparse.RemoteCmdSet) )
const ( ControlMasterUnset ControlMasterMode = ControlMasterMode(optparse.ControlMasterUnset) ControlMasterNo ControlMasterMode = ControlMasterMode(optparse.ControlMasterNo) ControlMasterYes ControlMasterMode = ControlMasterMode(optparse.ControlMasterYes) ControlMasterAsk ControlMasterMode = ControlMasterMode(optparse.ControlMasterAsk) ControlMasterAuto ControlMasterMode = ControlMasterMode(optparse.ControlMasterAuto) ControlMasterAutoAsk ControlMasterMode = ControlMasterMode(optparse.ControlMasterAutoAsk) ControlPathUnset ControlPathKind = ControlPathKind(optparse.ControlPathUnset) ControlPathDisabled ControlPathKind = ControlPathKind(optparse.ControlPathDisabled) ControlPathTemplate ControlPathKind = ControlPathKind(optparse.ControlPathTemplate) ControlPathLiteral ControlPathKind = ControlPathKind(optparse.ControlPathLiteral) ControlPersistUnset ControlPersistKind = ControlPersistKind(optparse.ControlPersistUnset) ControlPersistNo ControlPersistKind = ControlPersistKind(optparse.ControlPersistNo) ControlPersistIndefinite ControlPersistKind = ControlPersistKind(optparse.ControlPersistIndefinite) ControlPersistTimeout ControlPersistKind = ControlPersistKind(optparse.ControlPersistTimeout) )
const ( // DefaultStreamLocalBindMask 为 OpenSSH 默认 StreamLocalBindMask(0177)。 DefaultStreamLocalBindMask uint32 = optparse.DefaultStreamLocalBindMask // TunnelIDAny 表示 OpenSSH TunnelDevice 的 "any" 隧道单元号(0x7fffffff)。 TunnelIDAny uint32 = optparse.TunnelIDAny )
Variables ¶
var ( ErrInvalidOption = domi18n.Sentinel(domi18n.KeyOptionInvalidOption) ErrInvalidProxyRoute = domi18n.Sentinel(domi18n.KeyOptionInvalidProxyRoute) ErrInvalidControlPolicy = domi18n.Sentinel(domi18n.KeyOptionInvalidControlPolicy) ErrInvalidEnvFilter = domi18n.Sentinel(domi18n.KeyOptionInvalidEnvFilter) ErrInvalidPercentInput = domi18n.Sentinel(domi18n.KeyOptionInvalidPercentInput) ErrNilReceiver = domi18n.Sentinel(domi18n.KeyOptionNilReceiver) )
共享包级哨兵错误(由父包 core/domain/option 同源重导出,保证 errors.Is 指针同一性)。
Functions ¶
func ExpandLocalCommandRaw ¶
func ExpandProxyCommandRaw ¶
func ExpandProxyCommandRaw(raw string, ctx TokenContext, lookupEnv func(string) (string, bool)) ([]string, error)
ExpandProxyCommandRaw 与 ExpandLocalCommandRaw 组合执行阶段 1 分词校验与阶段 2 单词元展开。
Types ¶
type CommandTemplate ¶
type CommandTemplate struct {
// contains filtered or unexported fields
}
CommandTemplate 表示经 E3/C2 阶段 1 引号感知分词、原始模板元字符拦截与行首裸 exec 剥离后的不可变命令模板;零值恒无效。 阶段 2(Expand / ExpandExecutable)对每个词元执行单遍无重叠展开,杜绝空格拆词与二次变量展开注入。
func ParseLocalCommandTemplateRaw ¶
func ParseLocalCommandTemplateRaw(raw string) (CommandTemplate, error)
ParseLocalCommandTemplateRaw 执行 LocalCommand 阶段 1 解析(强制可执行词元 argv[0] 禁止 %T,参数词元放行 %T,拒绝未加引号 Shell 元字符)。
func ParseProxyCommandTemplateRaw ¶
func ParseProxyCommandTemplateRaw(raw string) (CommandTemplate, error)
ParseProxyCommandTemplateRaw 执行 ProxyCommand 阶段 1 解析(强制 %hnpr 占位符白名单,拒绝 %T 与未加引号 Shell 元字符)。
func (CommandTemplate) Expand ¶
func (c CommandTemplate) Expand(ctx TokenContext, lookupEnv func(string) (string, bool)) ([]string, error)
Expand 执行 E3/C2 阶段 2,按单词元单遍无重叠语义展开全部词元并返回最终零 Shell argv 切片。
func (CommandTemplate) ExpandExecutable ¶
func (c CommandTemplate) ExpandExecutable(ctx TokenContext, lookupEnv func(string) (string, bool)) (string, error)
ExpandExecutable 仅展开阶段 1 词元 0(可执行文件),供外层安全门控在租约/TUN 就绪前解析并冻结绝对可执行路径(禁止 %T)。
func (CommandTemplate) IsLocal ¶
func (c CommandTemplate) IsLocal() bool
func (CommandTemplate) IsValid ¶
func (c CommandTemplate) IsValid() bool
func (CommandTemplate) IsZero ¶
func (c CommandTemplate) IsZero() bool
func (CommandTemplate) TokenCount ¶
func (c CommandTemplate) TokenCount() int
type ControlMasterMode ¶
type ControlMasterMode uint8
func ParseControlMasterMode ¶
func ParseControlMasterMode(raw string) (ControlMasterMode, error)
ParseControlMasterMode 解析 ControlMaster(no/false/yes/true/ask/auto/autoask)。
func (ControlMasterMode) AppendText ¶
func (m ControlMasterMode) AppendText(b []byte) ([]byte, error)
func (ControlMasterMode) IsSet ¶
func (m ControlMasterMode) IsSet() bool
func (ControlMasterMode) MarshalText ¶
func (m ControlMasterMode) MarshalText() ([]byte, error)
func (ControlMasterMode) String ¶
func (m ControlMasterMode) String() string
func (*ControlMasterMode) UnmarshalText ¶
func (m *ControlMasterMode) UnmarshalText(t []byte) error
type ControlPathKind ¶
type ControlPathKind uint8
type ControlPathSpec ¶
type ControlPathSpec struct {
// contains filtered or unexported fields
}
ControlPathSpec 表示不可变的 ControlPath 规格值对象。
func DisabledControlPath ¶
func DisabledControlPath() ControlPathSpec
func NewLiteralControlPath ¶
func NewLiteralControlPath(s string) (ControlPathSpec, error)
func ParseControlPath ¶
func ParseControlPath(s string) (ControlPathSpec, error)
func UnsetControlPath ¶
func UnsetControlPath() ControlPathSpec
UnsetControlPath、DisabledControlPath、ParseControlPath、NewLiteralControlPath 及只读访问器。
func (ControlPathSpec) Equal ¶
func (s ControlPathSpec) Equal(o ControlPathSpec) bool
func (ControlPathSpec) IsDisabled ¶
func (s ControlPathSpec) IsDisabled() bool
func (ControlPathSpec) IsEnabled ¶
func (s ControlPathSpec) IsEnabled() bool
func (ControlPathSpec) IsLiteral ¶
func (s ControlPathSpec) IsLiteral() bool
func (ControlPathSpec) IsUnset ¶
func (s ControlPathSpec) IsUnset() bool
func (ControlPathSpec) Kind ¶
func (s ControlPathSpec) Kind() ControlPathKind
func (ControlPathSpec) String ¶
func (s ControlPathSpec) String() string
type ControlPersistKind ¶
type ControlPersistKind uint8
type ControlPersistSpec ¶
type ControlPersistSpec struct {
// contains filtered or unexported fields
}
ControlPersistSpec 表示不可变的 ControlPersist 规格,严格使用 algebraic.Duration(零裸 time.Duration)。
func DisabledControlPersist ¶
func DisabledControlPersist() ControlPersistSpec
func IndefiniteControlPersist ¶
func IndefiniteControlPersist() ControlPersistSpec
func ParseControlPersist ¶
func ParseControlPersist(raw string) (ControlPersistSpec, error)
func TimeoutControlPersist ¶
func TimeoutControlPersist(d algebraic.Duration) (ControlPersistSpec, error)
func UnsetControlPersist ¶
func UnsetControlPersist() ControlPersistSpec
UnsetControlPersist、DisabledControlPersist、IndefiniteControlPersist、TimeoutControlPersist 与 ParseControlPersist 构造驻留规格。
func (ControlPersistSpec) AppendText ¶
func (p ControlPersistSpec) AppendText(b []byte) ([]byte, error)
func (ControlPersistSpec) Equal ¶
func (p ControlPersistSpec) Equal(o ControlPersistSpec) bool
func (ControlPersistSpec) IsEnabled ¶
func (p ControlPersistSpec) IsEnabled() bool
func (ControlPersistSpec) IsIndefinite ¶
func (p ControlPersistSpec) IsIndefinite() bool
func (ControlPersistSpec) IsUnset ¶
func (p ControlPersistSpec) IsUnset() bool
func (ControlPersistSpec) Kind ¶
func (p ControlPersistSpec) Kind() ControlPersistKind
ControlPersistSpec 只读访问器与文本编解码方法。
func (ControlPersistSpec) MarshalText ¶
func (p ControlPersistSpec) MarshalText() ([]byte, error)
func (ControlPersistSpec) String ¶
func (p ControlPersistSpec) String() string
func (ControlPersistSpec) Timeout ¶
func (p ControlPersistSpec) Timeout() (algebraic.Duration, bool)
func (*ControlPersistSpec) UnmarshalText ¶
func (p *ControlPersistSpec) UnmarshalText(t []byte) error
type ControlPolicy ¶
type ControlPolicy struct {
// contains filtered or unexported fields
}
ControlPolicy 表示多路复用策略三槽 FirstWins 直积幺半群(ControlMaster × ControlPath × ControlPersist)。 Compose 保留原始三槽维持结合律与 ssh -G 对齐;运行期投影 EffectiveMaster/EffectivePersist 在 !IsEnabled() 时一律归零。
func FoldControlPolicies ¶
func FoldControlPolicies(ls ...ControlPolicy) ControlPolicy
func UnsetControlPolicy ¶
func UnsetControlPolicy() ControlPolicy
UnsetControlPolicy 及不可变槽位构造器、只读访问器、运行期投影、Compose 与 FoldControlPolicies。
func (ControlPolicy) Compose ¶
func (c ControlPolicy) Compose(lower ControlPolicy) ControlPolicy
func (ControlPolicy) EffectiveMaster ¶
func (c ControlPolicy) EffectiveMaster() ControlMasterMode
func (ControlPolicy) EffectivePersist ¶
func (c ControlPolicy) EffectivePersist() ControlPersistSpec
func (ControlPolicy) Equal ¶
func (c ControlPolicy) Equal(o ControlPolicy) bool
func (ControlPolicy) IsDisabled ¶
func (c ControlPolicy) IsDisabled() bool
func (ControlPolicy) IsEnabled ¶
func (c ControlPolicy) IsEnabled() bool
func (ControlPolicy) IsUnset ¶
func (c ControlPolicy) IsUnset() bool
func (ControlPolicy) IsZero ¶
func (c ControlPolicy) IsZero() bool
func (ControlPolicy) MarshalJSONTo ¶
func (c ControlPolicy) MarshalJSONTo(e *jsontext.Encoder) error
MarshalJSONTo 与 UnmarshalJSONFrom 实现 ControlPolicy 的 json/v2 确定性编解码。
func (ControlPolicy) Master ¶
func (c ControlPolicy) Master() ControlMasterMode
func (ControlPolicy) Path ¶
func (c ControlPolicy) Path() ControlPathSpec
func (ControlPolicy) Persist ¶
func (c ControlPolicy) Persist() ControlPersistSpec
func (*ControlPolicy) UnmarshalJSONFrom ¶
func (c *ControlPolicy) UnmarshalJSONFrom(d *jsontext.Decoder) error
func (ControlPolicy) WithMaster ¶
func (c ControlPolicy) WithMaster(m ControlMasterMode) ControlPolicy
func (ControlPolicy) WithPath ¶
func (c ControlPolicy) WithPath(p ControlPathSpec) ControlPolicy
func (ControlPolicy) WithPersist ¶
func (c ControlPolicy) WithPersist(p ControlPersistSpec) ControlPolicy
type DynamicForwardList ¶
type DynamicForwardList struct {
// contains filtered or unexported fields
}
DynamicForwardList 表示 DynamicForward 的保序去重追加幺半群(空列表为单位元)。
func FoldDynamicForwardLists ¶
func FoldDynamicForwardLists(ls ...DynamicForwardList) DynamicForwardList
func NewDynamicForwardList ¶
func NewDynamicForwardList(eps ...ForwardEndpoint) (DynamicForwardList, error)
func ParseDynamicForwardList ¶
func ParseDynamicForwardList(raws []string) (DynamicForwardList, error)
func UnsetDynamicForwardList ¶
func UnsetDynamicForwardList() DynamicForwardList
UnsetDynamicForwardList、NewDynamicForwardList、ParseDynamicForwardList 与 FoldDynamicForwardLists 构造及复合动态转发列表。
func (DynamicForwardList) Clone ¶
func (l DynamicForwardList) Clone() DynamicForwardList
Clone 返回动态转发列表的防御性深拷贝。
func (DynamicForwardList) Compose ¶
func (l DynamicForwardList) Compose(lo DynamicForwardList) DynamicForwardList
func (DynamicForwardList) Equal ¶
func (l DynamicForwardList) Equal(o DynamicForwardList) bool
func (DynamicForwardList) IsValidAll ¶
func (l DynamicForwardList) IsValidAll() bool
IsValidAll 校验动态转发列表内全部条目均合法且非 0 TCP 端口。
func (DynamicForwardList) MarshalJSONTo ¶
func (l DynamicForwardList) MarshalJSONTo(e *jsontext.Encoder) error
MarshalJSONTo 与 UnmarshalJSONFrom 实现 DynamicForwardList 的 json/v2 确定性编解码。
func (*DynamicForwardList) UnmarshalJSONFrom ¶
func (l *DynamicForwardList) UnmarshalJSONFrom(d *jsontext.Decoder) error
type EnvAssignment ¶
type EnvAssignment struct {
// contains filtered or unexported fields
}
EnvAssignment 表示单个经校验的 SetEnv KEY=VALUE 赋值对;零值恒无效。
func NewEnvAssignment ¶
func NewEnvAssignment(name, value string) (EnvAssignment, error)
NewEnvAssignment 校验并构造单个 SetEnv KEY=VALUE 赋值对。
func (EnvAssignment) Equal ¶
func (a EnvAssignment) Equal(o EnvAssignment) bool
func (EnvAssignment) IsValid ¶
func (a EnvAssignment) IsValid() bool
func (EnvAssignment) IsZero ¶
func (a EnvAssignment) IsZero() bool
func (EnvAssignment) Name ¶
func (a EnvAssignment) Name() string
func (EnvAssignment) String ¶
func (a EnvAssignment) String() string
func (EnvAssignment) Value ¶
func (a EnvAssignment) Value() string
type EnvFilter ¶
type EnvFilter struct {
// contains filtered or unexported fields
}
EnvFilter 表示 OpenSSH SendEnv 模式列表及 -PATTERN 减法语义的结合律幺半群。 正规形式 (clear, added) 在 Compose(higher, lower) 下先应用 lower 再应用 higher,满足结合律与单位元律。
func FoldEnvFilters ¶
func ParseEnvFilter ¶
ParseEnvFilter 解析空白分隔的一条或多条 SendEnv 模式(支持 PATTERN 与 -PATTERN)。
func ParseEnvFilterTokens ¶
ParseEnvFilterTokens 按序应用 SendEnv 令牌序列构造规范 EnvFilter。
func (EnvFilter) ClearPatterns ¶
func (EnvFilter) FilterNames ¶
func (EnvFilter) MarshalJSONTo ¶
MarshalJSONTo 与 UnmarshalJSONFrom 实现 EnvFilter 的 json/v2 确定性编解码。
type EnvSet ¶
type EnvSet struct {
// contains filtered or unexported fields
}
EnvSet 表示 OpenSSH SetEnv 指令的不可变 FirstWins 幺半群(首条非空指令获胜,严格对齐 ssh -G)。
func FoldEnvSets ¶
func NewEnvSet ¶
func NewEnvSet(items ...EnvAssignment) (EnvSet, error)
func ParseEnvSet ¶
func ParseEnvSetTokens ¶
func UnsetEnvSet ¶
func UnsetEnvSet() EnvSet
UnsetEnvSet、NewEnvSet、ParseEnvSet 与 ParseEnvSetTokens 构造 SetEnv 集合。
func (EnvSet) Items ¶
func (s EnvSet) Items() []EnvAssignment
func (EnvSet) MarshalJSONTo ¶
MarshalJSONTo 与 UnmarshalJSONFrom 实现 EnvSet 的 json/v2 确定性编解码。
type EscapeCharKind ¶
type EscapeCharKind uint8
type EscapeCharSpec ¶
type EscapeCharSpec struct {
// contains filtered or unexported fields
}
EscapeCharSpec 表示经校验的 OpenSSH EscapeChar 规格(none / 单可打印字符 / ^X);零值恒无效。
func DefaultEscapeCharSpec ¶
func DefaultEscapeCharSpec() EscapeCharSpec
DefaultEscapeCharSpec、DisabledEscapeCharSpec 与 ParseEscapeChar 构造 EscapeCharSpec。
func DisabledEscapeCharSpec ¶
func DisabledEscapeCharSpec() EscapeCharSpec
func ParseEscapeChar ¶
func ParseEscapeChar(raw string) (EscapeCharSpec, error)
func (EscapeCharSpec) AppendText ¶
func (e EscapeCharSpec) AppendText(b []byte) ([]byte, error)
func (EscapeCharSpec) Byte ¶
func (e EscapeCharSpec) Byte() (byte, bool)
func (EscapeCharSpec) Equal ¶
func (e EscapeCharSpec) Equal(o EscapeCharSpec) bool
func (EscapeCharSpec) IsDisabled ¶
func (e EscapeCharSpec) IsDisabled() bool
func (EscapeCharSpec) IsEnabled ¶
func (e EscapeCharSpec) IsEnabled() bool
func (EscapeCharSpec) IsValid ¶
func (e EscapeCharSpec) IsValid() bool
func (EscapeCharSpec) IsZero ¶
func (e EscapeCharSpec) IsZero() bool
func (EscapeCharSpec) Kind ¶
func (e EscapeCharSpec) Kind() EscapeCharKind
func (EscapeCharSpec) MarshalText ¶
func (e EscapeCharSpec) MarshalText() ([]byte, error)
func (EscapeCharSpec) String ¶
func (e EscapeCharSpec) String() string
func (*EscapeCharSpec) UnmarshalText ¶
func (e *EscapeCharSpec) UnmarshalText(t []byte) error
type ForwardAgentKind ¶
type ForwardAgentKind uint8
ForwardAgentKind 表示 OpenSSH ForwardAgent 四态类别枚举(零值 ForwardAgentUnset 失败关闭)。
const ( ForwardAgentUnset ForwardAgentKind = ForwardAgentKind(optparse.ForwardAgentUnset) // 未设置(零值失败关闭) ForwardAgentDisabled ForwardAgentKind = ForwardAgentKind(optparse.ForwardAgentDisabled) // 显式禁用(no) ForwardAgentDefault ForwardAgentKind = ForwardAgentKind(optparse.ForwardAgentDefault) // 默认启用(yes,继承 IdentityAgent) ForwardAgentCustomPath ForwardAgentKind = ForwardAgentKind(optparse.ForwardAgentCustomPath) // 自定义路径或 $ENV(覆写 IdentityAgent) )
type ForwardAgentSpec ¶
type ForwardAgentSpec struct {
// contains filtered or unexported fields
}
ForwardAgentSpec 表示经校验的 4 态 OpenSSH ForwardAgent 不可变值对象(Unset / Disabled / Default / CustomPath);零值恒无效。
func DefaultForwardAgent ¶
func DefaultForwardAgent() ForwardAgentSpec
func DisabledForwardAgent ¶
func DisabledForwardAgent() ForwardAgentSpec
func ForwardAgentFromBool ¶
func ForwardAgentFromBool(v bool) ForwardAgentSpec
func ParseForwardAgent ¶
func ParseForwardAgent(raw string) (ForwardAgentSpec, error)
func UnsetForwardAgent ¶
func UnsetForwardAgent() ForwardAgentSpec
UnsetForwardAgent、DisabledForwardAgent、DefaultForwardAgent、ForwardAgentFromBool 与 ParseForwardAgent 构造 ForwardAgentSpec。
func (ForwardAgentSpec) AppendText ¶
func (f ForwardAgentSpec) AppendText(b []byte) ([]byte, error)
func (ForwardAgentSpec) EnvVarName ¶
func (f ForwardAgentSpec) EnvVarName() string
func (ForwardAgentSpec) Equal ¶
func (f ForwardAgentSpec) Equal(o ForwardAgentSpec) bool
func (ForwardAgentSpec) IsCustomPath ¶
func (f ForwardAgentSpec) IsCustomPath() bool
func (ForwardAgentSpec) IsDefault ¶
func (f ForwardAgentSpec) IsDefault() bool
func (ForwardAgentSpec) IsDisabled ¶
func (f ForwardAgentSpec) IsDisabled() bool
func (ForwardAgentSpec) IsEnabled ¶
func (f ForwardAgentSpec) IsEnabled() bool
func (ForwardAgentSpec) IsEnvVar ¶
func (f ForwardAgentSpec) IsEnvVar() bool
func (ForwardAgentSpec) IsValid ¶
func (f ForwardAgentSpec) IsValid() bool
func (ForwardAgentSpec) IsZero ¶
func (f ForwardAgentSpec) IsZero() bool
func (ForwardAgentSpec) Kind ¶
func (f ForwardAgentSpec) Kind() ForwardAgentKind
func (ForwardAgentSpec) MarshalJSONTo ¶
func (f ForwardAgentSpec) MarshalJSONTo(enc *jsontext.Encoder) error
MarshalJSONTo 将有效 ForwardAgentSpec 编码为确定性 JSON 字符串(零值或无效值失败关闭)。
func (ForwardAgentSpec) MarshalText ¶
func (f ForwardAgentSpec) MarshalText() ([]byte, error)
func (ForwardAgentSpec) Path ¶
func (f ForwardAgentSpec) Path() string
func (ForwardAgentSpec) String ¶
func (f ForwardAgentSpec) String() string
func (*ForwardAgentSpec) UnmarshalJSONFrom ¶
func (f *ForwardAgentSpec) UnmarshalJSONFrom(dec *jsontext.Decoder) error
UnmarshalJSONFrom 兼容解码 JSON 布尔(true->Default / false->Disabled)与 JSON 字符串(no/yes/$ENV/路径),其余一律失败关闭。
func (*ForwardAgentSpec) UnmarshalText ¶
func (f *ForwardAgentSpec) UnmarshalText(t []byte) error
type ForwardEndpoint ¶
type ForwardEndpoint struct {
// contains filtered or unexported fields
}
ForwardEndpoint 表示经校验的 TCP 或 StreamLocal 转发端点(亦直接表示 DynamicForward);零值恒无效。
func ParseDynamicForward ¶
func ParseDynamicForward(raw string) (ForwardEndpoint, error)
ParseDynamicForward 解析 DynamicForward([bind_address:]port 或 StreamLocal 套接字路径)。
func (ForwardEndpoint) AppendText ¶
func (e ForwardEndpoint) AppendText(b []byte) ([]byte, error)
func (ForwardEndpoint) Equal ¶
func (e ForwardEndpoint) Equal(o ForwardEndpoint) bool
func (ForwardEndpoint) HasHost ¶
func (e ForwardEndpoint) HasHost() bool
func (ForwardEndpoint) Host ¶
func (e ForwardEndpoint) Host() string
func (ForwardEndpoint) IsUnix ¶
func (e ForwardEndpoint) IsUnix() bool
func (ForwardEndpoint) IsValid ¶
func (e ForwardEndpoint) IsValid() bool
func (ForwardEndpoint) IsWildcard ¶
func (e ForwardEndpoint) IsWildcard() bool
func (ForwardEndpoint) IsZero ¶
func (e ForwardEndpoint) IsZero() bool
func (ForwardEndpoint) MarshalText ¶
func (e ForwardEndpoint) MarshalText() ([]byte, error)
func (ForwardEndpoint) Port ¶
func (e ForwardEndpoint) Port() uint16
func (ForwardEndpoint) SocketPath ¶
func (e ForwardEndpoint) SocketPath() string
func (ForwardEndpoint) String ¶
func (e ForwardEndpoint) String() string
func (*ForwardEndpoint) UnmarshalText ¶
func (e *ForwardEndpoint) UnmarshalText(t []byte) error
type ForwardList ¶
type ForwardList struct {
// contains filtered or unexported fields
}
ForwardList 表示 LocalForward / RemoteForward 的保序去重追加幺半群(空列表为单位元)。
func FoldForwardLists ¶
func FoldForwardLists(ls ...ForwardList) ForwardList
func NewForwardList ¶
func NewForwardList(specs ...ForwardSpec) (ForwardList, error)
func ParseLocalForwardList ¶
func ParseLocalForwardList(raws []string) (ForwardList, error)
func ParseRemoteForwardList ¶
func ParseRemoteForwardList(raws []string) (ForwardList, error)
func UnsetForwardList ¶
func UnsetForwardList() ForwardList
UnsetForwardList、NewForwardList、ParseLocalForwardList、ParseRemoteForwardList 与 FoldForwardLists 构造及复合转发列表。
func (ForwardList) Compose ¶
func (l ForwardList) Compose(lo ForwardList) ForwardList
func (ForwardList) Equal ¶
func (l ForwardList) Equal(o ForwardList) bool
func (ForwardList) IsValidLocal ¶
func (l ForwardList) IsValidLocal() bool
IsValidLocal 校验列表全部条目均为合法 LocalForward 规范(禁止反向动态与 0 端口)。
func (ForwardList) IsValidRemote ¶
func (l ForwardList) IsValidRemote() bool
IsValidRemote 校验列表全部条目均为合法 RemoteForward 规范(允许反向动态与 0 端口)。
func (ForwardList) MarshalJSONTo ¶
func (l ForwardList) MarshalJSONTo(e *jsontext.Encoder) error
MarshalJSONTo 与 UnmarshalJSONFrom 实现 ForwardList 的 json/v2 确定性编解码。
func (*ForwardList) UnmarshalJSONFrom ¶
func (l *ForwardList) UnmarshalJSONFrom(d *jsontext.Decoder) error
type ForwardSpec ¶
type ForwardSpec struct {
// contains filtered or unexported fields
}
ForwardSpec 表示经校验的 LocalForward 或 RemoteForward 转发规范(支持反向动态 RemoteForward);零值恒无效。
func ParseLocalForward ¶
func ParseLocalForward(s string) (ForwardSpec, error)
ParseLocalForward 与 ParseRemoteForward 分别按 OpenSSH 语法解析本地与远端转发规范。
func ParseRemoteForward ¶
func ParseRemoteForward(s string) (ForwardSpec, error)
func (ForwardSpec) AppendText ¶
func (s ForwardSpec) AppendText(b []byte) ([]byte, error)
func (ForwardSpec) Bind ¶
func (s ForwardSpec) Bind() ForwardEndpoint
func (ForwardSpec) Dest ¶
func (s ForwardSpec) Dest() ForwardEndpoint
func (ForwardSpec) Equal ¶
func (s ForwardSpec) Equal(o ForwardSpec) bool
func (ForwardSpec) IsDynamic ¶
func (s ForwardSpec) IsDynamic() bool
func (ForwardSpec) IsValid ¶
func (s ForwardSpec) IsValid() bool
func (ForwardSpec) IsZero ¶
func (s ForwardSpec) IsZero() bool
func (ForwardSpec) MarshalText ¶
func (s ForwardSpec) MarshalText() ([]byte, error)
func (ForwardSpec) String ¶
func (s ForwardSpec) String() string
func (*ForwardSpec) UnmarshalText ¶
func (s *ForwardSpec) UnmarshalText(t []byte) error
type IdentityAgentKind ¶
type IdentityAgentKind uint8
type IdentityAgentSpec ¶
type IdentityAgentSpec struct {
// contains filtered or unexported fields
}
IdentityAgentSpec 表示经校验的 OpenSSH IdentityAgent 规格(none / SSH_AUTH_SOCK / $ENV / 路径模板);零值恒无效。
func DisabledIdentityAgent ¶
func DisabledIdentityAgent() IdentityAgentSpec
DisabledIdentityAgent、SSHAuthSockIdentityAgent 与 ParseIdentityAgent 构造 IdentityAgentSpec。
func ParseIdentityAgent ¶
func ParseIdentityAgent(raw string) (IdentityAgentSpec, error)
func SSHAuthSockIdentityAgent ¶
func SSHAuthSockIdentityAgent() IdentityAgentSpec
func (IdentityAgentSpec) AppendText ¶
func (a IdentityAgentSpec) AppendText(b []byte) ([]byte, error)
func (IdentityAgentSpec) EnvVarName ¶
func (a IdentityAgentSpec) EnvVarName() string
func (IdentityAgentSpec) Equal ¶
func (a IdentityAgentSpec) Equal(o IdentityAgentSpec) bool
func (IdentityAgentSpec) IsDisabled ¶
func (a IdentityAgentSpec) IsDisabled() bool
func (IdentityAgentSpec) IsSSHAuthSock ¶
func (a IdentityAgentSpec) IsSSHAuthSock() bool
func (IdentityAgentSpec) IsValid ¶
func (a IdentityAgentSpec) IsValid() bool
func (IdentityAgentSpec) IsZero ¶
func (a IdentityAgentSpec) IsZero() bool
func (IdentityAgentSpec) Kind ¶
func (a IdentityAgentSpec) Kind() IdentityAgentKind
func (IdentityAgentSpec) MarshalText ¶
func (a IdentityAgentSpec) MarshalText() ([]byte, error)
func (IdentityAgentSpec) String ¶
func (a IdentityAgentSpec) String() string
func (*IdentityAgentSpec) UnmarshalText ¶
func (a *IdentityAgentSpec) UnmarshalText(t []byte) error
type PreferredAuthList ¶
type PreferredAuthList struct {
// contains filtered or unexported fields
}
PreferredAuthList 表示经校验的 OpenSSH PreferredAuthentications 有序去重认证方法列表;零值恒无效。
func NewPreferredAuthentications ¶
func NewPreferredAuthentications(methods ...string) (PreferredAuthList, error)
func ParsePreferredAuthentications ¶
func ParsePreferredAuthentications(raw string) (PreferredAuthList, error)
ParsePreferredAuthentications 与 NewPreferredAuthentications 构造有序去重认证方式列表。
func (PreferredAuthList) AppendText ¶
func (p PreferredAuthList) AppendText(b []byte) ([]byte, error)
func (PreferredAuthList) Clone ¶
func (p PreferredAuthList) Clone() PreferredAuthList
Clone 返回认证方式列表的防御性深拷贝。
func (PreferredAuthList) Equal ¶
func (p PreferredAuthList) Equal(o PreferredAuthList) bool
func (PreferredAuthList) IsValid ¶
func (p PreferredAuthList) IsValid() bool
func (PreferredAuthList) IsZero ¶
func (p PreferredAuthList) IsZero() bool
func (PreferredAuthList) MarshalText ¶
func (p PreferredAuthList) MarshalText() ([]byte, error)
func (PreferredAuthList) Methods ¶
func (p PreferredAuthList) Methods() []string
func (PreferredAuthList) String ¶
func (p PreferredAuthList) String() string
func (*PreferredAuthList) UnmarshalText ¶
func (p *PreferredAuthList) UnmarshalText(t []byte) error
type RemoteCommandKind ¶
type RemoteCommandKind uint8
type RemoteCommandSpec ¶
type RemoteCommandSpec struct {
// contains filtered or unexported fields
}
RemoteCommandSpec 表示经校验的 OpenSSH RemoteCommand 规格("none" 禁用或整行命令模板);零值恒无效。
func DisabledRemoteCommand ¶
func DisabledRemoteCommand() RemoteCommandSpec
DisabledRemoteCommand 与 ParseRemoteCommand 构造 RemoteCommandSpec。
func ParseRemoteCommand ¶
func ParseRemoteCommand(raw string) (RemoteCommandSpec, error)
func (RemoteCommandSpec) AppendText ¶
func (r RemoteCommandSpec) AppendText(b []byte) ([]byte, error)
func (RemoteCommandSpec) Equal ¶
func (r RemoteCommandSpec) Equal(o RemoteCommandSpec) bool
func (RemoteCommandSpec) IsDisabled ¶
func (r RemoteCommandSpec) IsDisabled() bool
func (RemoteCommandSpec) IsEnabled ¶
func (r RemoteCommandSpec) IsEnabled() bool
func (RemoteCommandSpec) IsValid ¶
func (r RemoteCommandSpec) IsValid() bool
func (RemoteCommandSpec) IsZero ¶
func (r RemoteCommandSpec) IsZero() bool
func (RemoteCommandSpec) Kind ¶
func (r RemoteCommandSpec) Kind() RemoteCommandKind
func (RemoteCommandSpec) MarshalText ¶
func (r RemoteCommandSpec) MarshalText() ([]byte, error)
func (RemoteCommandSpec) String ¶
func (r RemoteCommandSpec) String() string
func (*RemoteCommandSpec) UnmarshalText ¶
func (r *RemoteCommandSpec) UnmarshalText(t []byte) error
type StreamLocalBindMask ¶
type StreamLocalBindMask struct {
// contains filtered or unexported fields
}
StreamLocalBindMask 表示经校验的 Unix 域套接字八进制绑定掩码(0000..0777);零值恒无效。
func DefaultStreamLocalBindMaskSpec ¶
func DefaultStreamLocalBindMaskSpec() StreamLocalBindMask
DefaultStreamLocalBindMaskSpec 返回 OpenSSH 默认 StreamLocalBindMask(0177)不可变值对象。
func NewStreamLocalBindMask ¶
func NewStreamLocalBindMask(mask uint32) (StreamLocalBindMask, error)
NewStreamLocalBindMask 与 ParseStreamLocalBindMask 构造不可变八进制绑定掩码值对象。
func ParseStreamLocalBindMask ¶
func ParseStreamLocalBindMask(raw string) (StreamLocalBindMask, error)
func (StreamLocalBindMask) AppendText ¶
func (m StreamLocalBindMask) AppendText(b []byte) ([]byte, error)
func (StreamLocalBindMask) Equal ¶
func (m StreamLocalBindMask) Equal(o StreamLocalBindMask) bool
func (StreamLocalBindMask) IsValid ¶
func (m StreamLocalBindMask) IsValid() bool
func (StreamLocalBindMask) IsZero ¶
func (m StreamLocalBindMask) IsZero() bool
func (StreamLocalBindMask) MarshalText ¶
func (m StreamLocalBindMask) MarshalText() ([]byte, error)
func (StreamLocalBindMask) String ¶
func (m StreamLocalBindMask) String() string
func (*StreamLocalBindMask) UnmarshalText ¶
func (m *StreamLocalBindMask) UnmarshalText(t []byte) error
func (StreamLocalBindMask) Value ¶
func (m StreamLocalBindMask) Value() uint32
type TokenContext ¶
type TokenContext struct {
LocalHost string // 本机完整主机名(%l,%L 取首个 '.' 之前前缀)
TargetHost string // 规范化远端目标主机名或 IP(%h)
Port uint16 // 目标 SSH 端口(%p,位于 [1, 65535])
RemoteUser string // 远端用户名(%r,空时回退至 LocalUser)
OriginalHost string // 原始主机或别名(%n,空时回退至 TargetHost)
LocalUser string // 本机用户名(%u)
LocalUID string // 本机数值 UID(%i)
HomeDir string // 本机用户主目录(%d)
JumpHost string // 活跃 ProxyJump 末跳无方括号规范主机名(%j,无跳板时为空串)
TunnelDevice string // 本地 TUN/TAP 设备名(%T,仅 LocalCommand 放行;无 TUN 时由调用方传 "NONE")
}
TokenContext 为 OpenSSH % token 纯字符串展开提供全部显式输入(零 os.Hostname / os/user 隐式访问)。 字段顺序与 optparse.TokenInput 严格同构;由父包 core/domain/option 经类型别名零破坏重导出。
type TunnelDeviceSpec ¶
type TunnelDeviceSpec struct {
// contains filtered or unexported fields
}
TunnelDeviceSpec 表示 OpenSSH TunnelDevice(local[:remote])不可变隧道设备规格;零值恒无效。
func DefaultTunnelDeviceSpec ¶
func DefaultTunnelDeviceSpec() TunnelDeviceSpec
DefaultTunnelDeviceSpec、NewTunnelDeviceSpec 与 ParseTunnelDevice 构造隧道设备规格。
func NewTunnelDeviceSpec ¶
func NewTunnelDeviceSpec(localUnit, remoteUnit uint32) (TunnelDeviceSpec, error)
func ParseTunnelDevice ¶
func ParseTunnelDevice(raw string) (TunnelDeviceSpec, error)
func (TunnelDeviceSpec) AppendText ¶
func (d TunnelDeviceSpec) AppendText(b []byte) ([]byte, error)
func (TunnelDeviceSpec) Equal ¶
func (d TunnelDeviceSpec) Equal(o TunnelDeviceSpec) bool
func (TunnelDeviceSpec) IsValid ¶
func (d TunnelDeviceSpec) IsValid() bool
func (TunnelDeviceSpec) IsZero ¶
func (d TunnelDeviceSpec) IsZero() bool
func (TunnelDeviceSpec) LocalUnit ¶
func (d TunnelDeviceSpec) LocalUnit() uint32
func (TunnelDeviceSpec) MarshalText ¶
func (d TunnelDeviceSpec) MarshalText() ([]byte, error)
func (TunnelDeviceSpec) RemoteUnit ¶
func (d TunnelDeviceSpec) RemoteUnit() uint32
func (TunnelDeviceSpec) String ¶
func (d TunnelDeviceSpec) String() string
func (*TunnelDeviceSpec) UnmarshalText ¶
func (d *TunnelDeviceSpec) UnmarshalText(t []byte) error