Documentation
¶
Overview ¶
Package addresses provides utilities for parsing HTCondor addresses and handling different connection types including shared port connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BrokerIsCCB ¶ added in v0.4.0
BrokerIsCCB reports whether a broker address extracted by SplitCCBContact is itself CCB-routed (a nested contact with a further hop), i.e. it still carries a '#'. A new client uses this to decide whether to recurse.
func IsValidSharedPortID ¶
IsValidSharedPortID validates a shared port ID according to HTCondor rules The ID must contain only alphanumeric characters, dots, dashes, and underscores
func SplitCCBContact ¶ added in v0.1.0
SplitCCBContact splits a "<broker-address>#<ccbid>" contact into its broker address and id, peeling ONE hop. It splits on the LAST '#' so that a *nested* (multi-hop tunnel) contact works: brokerAddr may itself be a contact, e.g. "192.0.2.10:9618#42#17" -> broker="192.0.2.10:9618#42", id="17" (recurse on the broker; see the CCB tunneling design §4.7). A flat single-hop contact has one '#', for which split-on-last == split-on-first, so normal CCB is unchanged.
Angle brackets are stripped only when they wrap the whole broker (a bare "<host:port>" entry broker), never when the broker is itself a nested contact like "<host:port>#42" (whose brackets belong to the inner sinful). Use '#' (not '%') as the hop separator because '%' collides with %XX sinful escaping.
Types ¶
type CCBContact ¶ added in v0.1.0
type CCBContact struct {
BrokerAddr string // broker address without angle brackets, e.g. "192.168.1.1:9618"
CCBID string // the broker-assigned id, e.g. "42"
Raw string // the full "addr#id" contact string
}
CCBContact is a single Condor Connection Broker contact extracted from a sinful string's "ccbid" parameter. On the wire a contact has the form "<broker-address>#<ccbid>" where the broker address has NO angle brackets (e.g. "192.168.1.1:9618#42"), matching CCBServer::CCBIDToContactString in the HTCondor C++ source.
type SharedPortInfo ¶
type SharedPortInfo struct {
}
SharedPortInfo contains information extracted from a shared port address
func ParseHTCondorAddress ¶
func ParseHTCondorAddress(address string) SharedPortInfo
ParseHTCondorAddress parses HTCondor addresses that may contain shared port information
HTCondor addresses with shared port info look like: - "<host:port?sock=shared_port_id>" - "host:port?sock=shared_port_id"
HTCondor addresses may also contain other query parameters (e.g., addrs, alias, CCBID) which should be stripped from the server address: - "<127.0.0.1:41919?addrs=127.0.0.1-41919&alias=hostname>"
Returns SharedPortInfo with the parsed information
type SinfulInfo ¶ added in v0.1.0
type SinfulInfo struct {
Raw string // the original input
PrimaryAddr string // primary "host:port" (brackets/params stripped)
Host string // host portion of PrimaryAddr
Port string // port portion of PrimaryAddr
CCBContacts []CCBContact // "ccbid" parameter, parsed (space-separated list)
PrivateAddr string // "PrivAddr" parameter, if any
PrivateNet string // "PrivNet" parameter, if any
Alias string // "alias" parameter, if any
NoUDP bool // "noUDP" parameter present
Addrs []string // "addrs" parameter, split on '+'
Params map[string]string // all decoded query parameters
}
SinfulInfo is the parsed form of an HTCondor "sinful" string. It supersedes SharedPortInfo (which only understood the "sock" parameter) by also understanding CCB routing ("ccbid"), private addresses ("PrivAddr"), "noUDP", and the other v0 sinful query parameters. The v0 format is:
<host:port?key1=value1&key2=value2&...>
where keys and values are url-encoded with %XX escapes and pairs are delimited by '&' or ';' (see parseUrlEncodedParams in condor_sinful.cpp).
func ParseSinful ¶ added in v0.1.0
func ParseSinful(addr string) (SinfulInfo, error)
ParseSinful parses an HTCondor v0 sinful string. Angle brackets are optional. It never fails on unknown parameters; an error is returned only for malformed url-encoding.
func (SinfulInfo) IsCCB ¶ added in v0.1.0
func (s SinfulInfo) IsCCB() bool
IsCCB reports whether the address must be reached via the Condor Connection Broker (i.e. it carries one or more ccb contacts).
func (SinfulInfo) IsSharedPort ¶ added in v0.1.0
func (s SinfulInfo) IsSharedPort() bool
IsSharedPort reports whether the address routes through a shared-port daemon.