29 lines
517 B
Go
29 lines
517 B
Go
package emapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
// Option is a Client configuration Option definition.
|
|
type Option func(c *Client) error
|
|
|
|
// WithLogger sets the logger for the client.
|
|
func WithLogger(logger *zap.SugaredLogger) Option {
|
|
return func(c *Client) error {
|
|
c.logger = logger
|
|
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// WithHTTPClient sets the http client to be used by the client.
|
|
func WithHTTPClient(httpClient *http.Client) Option {
|
|
return func(c *Client) error {
|
|
c.httpClient = httpClient
|
|
|
|
return nil
|
|
}
|
|
}
|