func NewClientWithOptions(serverURL string, authToken string, options *Options) Client {
	normServerURL := serverURL
	if !strings.HasSuffix(normServerURL, "/") {
		normServerURL = serverURL + "/"
	}
	authorization := ""
	if len(authToken) > 0 {
		authorization = "Token " + authToken
	}
	service := http.NewService(normServerURL, authorization, options.httpOptions)
	client := &clientImpl{
		serverURL:     serverURL,
		options:       options,
		writeAPIs:     make(map[string]api.WriteAPI, 5),
		syncWriteAPIs: make(map[string]api.WriteAPIBlocking, 5),
		httpService:   service,
		apiClient:     domain.NewClientWithResponses(service),
	}
	if log.Log != nil {
		log.Log.SetLogLevel(options.LogLevel())
	}
	ilog.Infof("Using URL '%s', token '%s'", serverURL, authToken)
	return client
}
NewClientWithOptions creates Client for connecting to given serverURL with provided authentication token
and configured with custom Options.
serverURL is the InfluxDB server base URL, e.g. http://localhost:8086,
authToken is an authentication token. It can be empty in case of connecting to newly installed InfluxDB server, which has not been set up yet.
In such case, calling Setup() will set authentication token
package influxdb2
import (
	"context"
	"errors"
	"strings"
	"sync"
	"time"
	"github.com/influxdata/influxdb-client-go/v2/api"
	"github.com/influxdata/influxdb-client-go/v2/api/http"
	"github.com/influxdata/influxdb-client-go/v2/domain"
	ilog "github.com/influxdata/influxdb-client-go/v2/internal/log"
	"github.com/influxdata/influxdb-client-go/v2/log"
)
type Client interface {
	Setup(ctx context.Context, username, password, org, bucket string, retentionPeriodHours int) (*domain.OnboardingResponse, error)
	Ready(ctx context.Context) (bool, error)
	Health(ctx context.Context) (*domain.HealthCheck, error)
	Close()
	Options() *Options
	ServerURL() string
	HTTPService() http.Service
	WriteAPI(org, bucket string) api.WriteAPI
	WriteAPIBlocking(org, bucket string) api.WriteAPIBlocking
	QueryAPI(org string) api.QueryAPI
	AuthorizationsAPI() api.AuthorizationsAPI
	OrganizationsAPI() api.OrganizationsAPI
	UsersAPI() api.UsersAPI
	DeleteAPI() api.DeleteAPI
	BucketsAPI() api.BucketsAPI
	LabelsAPI() api.LabelsAPI
	TasksAPI() api.TasksAPI
}
type clientImpl struct {
	serverURL     string
	options       *Options
	writeAPIs     map[string]api.WriteAPI
	syncWriteAPIs map[string]api.WriteAPIBlocking
	lock          sync.Mutex
	httpService   http.Service
	apiClient     *domain.ClientWithResponses
	authAPI       api.AuthorizationsAPI
	orgAPI        api.OrganizationsAPI
	usersAPI      api.UsersAPI
	deleteAPI     api.DeleteAPI
	bucketsAPI    api.BucketsAPI
	labelsAPI     api.LabelsAPI
	tasksAPI      api.TasksAPI
}
func NewClient(serverURL string, authToken string) Client {
	return NewClientWithOptions(serverURL, authToken, DefaultOptions())
}