func New(baseURL string, opts ...Option) (*Client, error) {
	var c Client
	var err error
	c.Headers = make(map[string]string)
	c.baseURL, err = url.Parse(baseURL)
	if err != nil {
		return nil, err
	}
	if !strings.HasSuffix(c.baseURL.Path, "/") {
		c.baseURL.Path += "/"
	}
	for _, opt := range opts {
		opt(&c)
	}
	if c.httpClient == nil {
		c.httpClient = http.DefaultClient
	}
	c.Logger = zerolog.New(os.Stderr).With().Timestamp().Logger()
	c.WatchRetryDelay = watchDelay
	c.RetryDelay = retryDelay
	c.Retries = retries
	c.Rulesets = &RulesetService{
		client: &c,
	}
	return &c, nil
}
New creates an HTTP client that uses a base url to communicate with the api server.
package client
import (
	"bytes"
	"context"
	"encoding/json"
	"io"
	"io/ioutil"
	"net"
	"net/http"
	"net/url"
	"os"
	"strings"
	"time"
	"github.com/heetch/regula/api"
	"github.com/heetch/regula/version"
	"github.com/rs/zerolog"
	"golang.org/x/net/context/ctxhttp"
)
const (
	userAgent  = "Regula/" + version.Version + " Go"
	watchDelay = 1 * time.Second
	retryDelay = 250 * time.Millisecond
	retries    = 3
)
type Client struct {
	Logger          zerolog.Logger
	WatchRetryDelay time.Duration  
	RetryDelay      time.Duration  
	Retries         int            
	baseURL         *url.URL
	httpClient      *http.Client
	Headers  map[string]string
	Rulesets *RulesetService
}