Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EnvClientTimeout = os.Getenv("CLIENT_TIMEOUT")
)
View Source
var (
RetryDelay = 3 * time.Second
)
Functions ¶
func NewHttpClientOrDie ¶
func NewHttpClientOrDie(opts ...Option) client.HttpRequestDoer
Types ¶
type CertRefresher ¶
CertRefresher is a utility to refresh the CA certificates from a file periodically. It is useful for applications that need to maintain a valid certificate pool
func NewCertRefresher ¶
func NewCertRefresher(filepath string) *CertRefresher
func (*CertRefresher) Watch ¶
func (c *CertRefresher) Watch(ctx context.Context)
type HttpError ¶
type HttpError struct {
// contains filtered or unexported fields
}
HttpError implement the common/pkg/errors/ctrlerrors.Error interface However, we do not want to introduce a dependency from common-server/pkg/client to common/pkg/errors
func BlockedErrorf ¶
func RetryableErrorf ¶
func (*HttpError) IsRetryable ¶
func (*HttpError) RetryDelay ¶
func (*HttpError) StatusCode ¶
func (*HttpError) WithStatusCode ¶
type Option ¶
type Option func(*Options)
func WithCaFilepath ¶
func WithClientName ¶
func WithClientTimeout ¶
func WithReplacePattern ¶
func WithSkipTlsVerify ¶
type Options ¶
type Options struct {
// ClientName is used for metrics.
ClientName string
// ReplacePattern is used to obfuscate parts of the URL-path
// used in metrics collections.
ReplacePattern string
// SkipTlsVerify skips TLS verification.
SkipTlsVerify bool
// CaFilepath is the path to the CA certificate file.
// If empty, the system's default CA certificates are used.
// If SkipTlsVerify is true, this option is ignored.
CaFilepath string
// ClientTimeout is the timeout for HTTP requests.
ClientTimeout time.Duration
}
Click to show internal directories.
Click to hide internal directories.