addresses

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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 IsValidSharedPortID

func IsValidSharedPortID(id string) bool

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

func SplitCCBContact(contact string) (brokerAddr, ccbid string, ok bool)

SplitCCBContact splits a "<broker-address>#<ccbid>" contact string into its broker address (no angle brackets) and id. Mirrors CCBClient::SplitCCBContact in the HTCondor C++ source, splitting on the first '#'.

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 {
	ServerAddr   string // The address of the shared port server
	SharedPortID string // The shared port ID
	IsSharedPort bool   // True if this is a shared port address
}

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
	SharedPortID string            // "sock" parameter, if any
	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.

Jump to

Keyboard shortcuts

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