func WithBaseURL(baseURL string) ClientOption {
	return func(o *clientOptions) {
		o.baseURL = baseURL
	}
}
WithBaseURL returns an option which overrides the base URL.
package scryfall
import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"strings"
	"time"
	"go.uber.org/ratelimit"
)
const (
	defaultBaseURL = "https://api.scryfall.com"
	defaultTimeout = 30 * time.Second
	defaultReqPerSecond = 10
	userAgent      = "go-scryfall"
	dateFormat      = "2006-01-02"
	timestampFormat = "2006-01-02T15:04:05.999Z07:00"
)
var ErrMultipleSecrets = errors.New("multiple secrets configured")
type Color string
const (
	ColorWhite Color = "W"
	ColorBlue Color = "U"
	ColorBlack Color = "B"
	ColorRed Color = "R"
	ColorGreen Color = "G"
)
type Date struct {
	time.Time
}
func (d *Date) UnmarshalJSON(b []byte) error {
	s := strings.Trim(string(b), "\"")
	if s == "null" {
		return nil
	}
	parsedTime, err := time.ParseInLocation(dateFormat, s, time.FixedZone("UTC-8", -8*60*60))
	if err != nil {
		return err
	}
	d.Time = parsedTime
	return nil
}
type Timestamp struct {
	time.Time
}
func (t *Timestamp) UnmarshalJSON(b []byte) error {
	s := strings.Trim(string(b), "\"")
	if s == "null" {
		return nil
	}
	parsedTime, err := time.Parse(timestampFormat, s)
	if err != nil {
		return err
	}
	t.Time = parsedTime
	return nil
}
type Error struct {
	Status   int      `json:"status"`
	Code     string   `json:"code"`
	Details  string   `json:"details"`
	Type     *string  `json:"type"`
	Warnings []string `json:"warnings"`
}
func (e *Error) Error() string {
	return fmt.Sprintf("%s: %s", e.Code, e.Details)
}
type clientOptions struct {
	baseURL      string
	clientSecret string
	grantSecret  string
	client       *http.Client
	limiter ratelimit.Limiter
}
type ClientOption func(*clientOptions)