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

@@ -9,11 +9,11 @@ import (
)
// Option is a Client configuration Option definition.
type Option func(c *Client) error
type Option func(c *client) error
// WithProvider sets the provider on the client.
func WithProvider(provider providers.Provider) Option {
return func(c *Client) error {
return func(c *client) error {
c.provider = provider
return nil
@@ -22,7 +22,7 @@ func WithProvider(provider providers.Provider) Option {
// WithLogger sets the logger for the client.
func WithLogger(logger *zap.Logger) Option {
return func(c *Client) error {
return func(c *client) error {
c.logger = logger
return nil
@@ -31,7 +31,7 @@ func WithLogger(logger *zap.Logger) Option {
// WithConfig applies all configurations defined in the config.
func WithConfig(config Config) Option {
return func(c *Client) error {
return func(c *client) error {
var options []Option
if config.EMGQL.Populated() {