Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cdoucy committed Oct 15, 2024
1 parent bf8630e commit 64ef781
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 64ef781

Please sign in to comment.