Documentation
¶
Overview ¶
Package client provides HTCondor API client implementations using the CEDAR protocol.
This package will eventually contain clients for various HTCondor operations, starting with a condor_status equivalent.
Index ¶
- Constants
- type ClientConfig
- type HTCondorClient
- func ConnectAndAuthenticate(ctx context.Context, address string, securityConfig *security.SecurityConfig) (*HTCondorClient, error)
- func ConnectAndAuthenticateWithConfig(ctx context.Context, config *ClientConfig) (*HTCondorClient, error)
- func ConnectToAddress(ctx context.Context, address string) (*HTCondorClient, error)
- func NewClient(config *ClientConfig) *HTCondorClient
Constants ¶
const DefaultDialerFallbackDelay = 150 * time.Millisecond
DefaultDialerFallbackDelay is the IPv6→IPv4 happy-eyeballs switch-over time used when ClientConfig.FallbackDelay is zero. 150 ms matches the typical higher-level cross-collector race stagger so the two failover mechanisms compose without one drowning the other in concurrent socket attempts.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConfig ¶
type ClientConfig struct {
// Address is the HTCondor daemon address. Can be:
// - "host:port" for direct TCP connection
// - "host:port?sock=daemon_id" for shared port connection
// - "<host:port?sock=daemon_id>" for shared port connection (HTCondor format)
Address string
// Deprecated: Use Address field instead
Host string
// Deprecated: Use Address field instead
Port int
// Timeout for connection establishment (default: 30 seconds)
Timeout time.Duration
// FallbackDelay controls the IPv6/IPv4 "happy eyeballs" race
// inside net.Dialer.DialContext when the resolved hostname has
// both AAAA and A records. Go's default is 300 ms; we drop it
// to 150 ms so failover off a dead IPv6 path stays snappy.
// Pass a negative value to disable the inner race (matches
// net.Dialer's documented contract for negative FallbackDelay).
// Zero = use DefaultDialerFallbackDelay.
FallbackDelay time.Duration
// ClientName for shared port connections (for debugging)
ClientName string
Security *security.SecurityConfig
// CCBReturnAddr, if set, enables streaming/proxy mode for CCB sinful
// addresses: it is this client's own CCB sinful (carrying a ccbid), used
// when the client is itself behind CCB and cannot accept a direct reverse
// connection.
CCBReturnAddr string
// CCBRequireStreaming makes streaming mode mandatory for CCB addresses
// (fail fast if the broker does not support it).
CCBRequireStreaming bool
}
ClientConfig holds configuration for HTCondor client connections
type HTCondorClient ¶
type HTCondorClient struct {
// contains filtered or unexported fields
}
HTCondorClient represents a client connection to an HTCondor daemon
func ConnectAndAuthenticate ¶
func ConnectAndAuthenticate(ctx context.Context, address string, securityConfig *security.SecurityConfig) (*HTCondorClient, error)
ConnectAndAuthenticate establishes a connection and performs authentication handshake with automatic retry on session resumption failures. This is the recommended method for establishing authenticated connections to HTCondor daemons.
If session resumption fails (e.g., SID_NOT_FOUND), the function will: 1. Close the current connection 2. Establish a new connection 3. Retry the handshake (which will perform full authentication)
This ensures that failed session resumption attempts don't leave the stream in an unusable state.
func ConnectAndAuthenticateWithConfig ¶
func ConnectAndAuthenticateWithConfig(ctx context.Context, config *ClientConfig) (*HTCondorClient, error)
ConnectAndAuthenticateWithConfig is like ConnectAndAuthenticate but accepts a full ClientConfig
func ConnectToAddress ¶
func ConnectToAddress(ctx context.Context, address string) (*HTCondorClient, error)
ConnectToAddress is a convenience method that creates a client and connects to the specified address
func NewClient ¶
func NewClient(config *ClientConfig) *HTCondorClient
NewClient creates a new HTCondor client
func (*HTCondorClient) Close ¶
func (c *HTCondorClient) Close() error
Close closes the client connection
func (*HTCondorClient) Connect ¶
func (c *HTCondorClient) Connect(ctx context.Context) error
Connect establishes a connection to the HTCondor daemon
func (*HTCondorClient) GetSecurityNegotiation ¶
func (c *HTCondorClient) GetSecurityNegotiation() *security.SecurityNegotiation
GetSecurityNegotiation returns the security negotiation outcome from the authentication handshake. Returns nil if no authentication was performed.
func (*HTCondorClient) GetStream ¶
func (c *HTCondorClient) GetStream() *stream.Stream
GetStream returns the underlying CEDAR stream for advanced operations
func (*HTCondorClient) IsConnected ¶
func (c *HTCondorClient) IsConnected() bool
IsConnected returns true if the client is connected to a daemon
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sharedport provides client functionality for HTCondor's shared port protocol.
|
Package sharedport provides client functionality for HTCondor's shared port protocol. |