From 64ef781c9f44ebee9beb4951eb0e5aac0c20f17d Mon Sep 17 00:00:00 2001 From: Clement Doucy Date: Tue, 15 Oct 2024 20:25:38 +0200 Subject: [PATCH] comments --- client.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index e8aca7f..f9b64e1 100644 --- a/client.go +++ b/client.go @@ -1377,10 +1377,13 @@ func (c *Client) SetRootCertificate(pemFilePath string) *Client { // SetRootCertificateWatcher enables dynamic reloading of one or more root certificates. // It is designed for scenarios involving long-running Resty clients where certificates may be renewed. +// The caller is responsible for calling Close to stop the watcher. // // client.SetRootCertificateWatcher("root-ca.crt", &CertWatcherOptions{ -// PoolInterval: time.Hours * 24, +// PoolInterval: time.Hour * 24, // }) +// +// defer client.Close() func (c *Client) SetRootCertificateWatcher(pemFilePath string, options *CertWatcherOptions) *Client { c.SetRootCertificate(pemFilePath) c.initCertWatcher(pemFilePath, "root", options) @@ -1416,12 +1419,14 @@ type CertWatcherOptions struct { PoolInterval time.Duration } -// SetClientRootCertificateWatcher enables dynamic reloading of one or more rclient oot certificates. +// SetClientRootCertificateWatcher enables dynamic reloading of one or more client root certificates. // It is designed for scenarios involving long-running Resty clients where certificates may be renewed. +// The caller is responsible for calling Close to stop the watcher. // // client.SetClientRootCertificateWatcher("root-ca.crt", &CertWatcherOptions{ -// PoolInterval: time.Hours * 24, -// }) +// PoolInterval: time.Hour * 24, +// }) +// defer client.Close() func (c *Client) SetClientRootCertificateWatcher(pemFilePath string, options *CertWatcherOptions) *Client { c.SetClientRootCertificate(pemFilePath) c.initCertWatcher(pemFilePath, "client", options)