make client interface

This commit is contained in:
Mike Mason
2023-07-18 13:36:41 +00:00
parent 05762f5d75
commit f828546cfe
10 changed files with 72 additions and 46 deletions

View File

@@ -7,11 +7,11 @@ import (
)
// Option is a client configuration option definition.
type Option func(*Client) error
type Option func(*client) error
// WithLogger sets the logger for the client.
func WithLogger(logger *zap.SugaredLogger) Option {
return func(c *Client) error {
return func(c *client) error {
c.logger = logger
return nil
@@ -19,9 +19,9 @@ func WithLogger(logger *zap.SugaredLogger) Option {
}
// WithHTTPClient sets the http client to be used by the client.
func WithHTTPClient(client *http.Client) Option {
return func(c *Client) error {
c.httpClient = client
func WithHTTPClient(httpClient *http.Client) Option {
return func(c *client) error {
c.httpClient = httpClient
return nil
}