Documentation ¶
Index ¶
- func CanCreateTCPConnection(address string, config *Config) bool
- func CanPerformStartTLS(address string, config *Config) (connected bool, certificate *x509.Certificate, err error)
- func CanPerformTLS(address string, config *Config) (connected bool, certificate *x509.Certificate, err error)
- func GetHTTPClient(config *Config) *http.Client
- func Ping(address string, config *Config) (bool, time.Duration)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanCreateTCPConnection ¶
CanCreateTCPConnection checks whether a connection can be established with a TCP service
func CanPerformStartTLS ¶
func CanPerformStartTLS(address string, config *Config) (connected bool, certificate *x509.Certificate, err error)
CanPerformStartTLS checks whether a connection can be established to an address using the STARTTLS protocol
func CanPerformTLS ¶
func CanPerformTLS(address string, config *Config) (connected bool, certificate *x509.Certificate, err error)
CanPerformTLS checks whether a connection can be established to an address using the TLS protocol
func GetHTTPClient ¶
GetHTTPClient returns the shared HTTP client
Types ¶
type Config ¶
type Config struct { // Insecure determines whether to skip verifying the server's certificate chain and host name Insecure bool `yaml:"insecure"` // IgnoreRedirect determines whether to ignore redirects (true) or follow them (false, default) IgnoreRedirect bool `yaml:"ignore-redirect"` // Timeout for the client Timeout time.Duration `yaml:"timeout"` // contains filtered or unexported fields }
Config is the configuration for clients
func GetDefaultConfig ¶
func GetDefaultConfig() *Config
GetDefaultConfig returns a copy of the default configuration
func (*Config) ValidateAndSetDefaults ¶
func (c *Config) ValidateAndSetDefaults()
ValidateAndSetDefaults validates the client configuration and sets the default values if necessary
Click to show internal directories.
Click to hide internal directories.