func (c *Client) GetFromRayID(zoneID string, rayID string) (*Meta, error) {
	params := url.Values{}
	params.Set("rayid", rayID)
	url, err := c.buildURL(zoneID, params)
	if err != nil {
		return nil, err
	}
	return c.request(url)
}
GetFromRayID fetches a log entry based on a provided Ray ID value.
package logshare
import (
	"bufio"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"os"
	"path"
	"strconv"
	"strings"
	"time"
	"github.com/pkg/errors"
)
const (
	apiURL     = "https://api.cloudflare.com/client/v4"
	unix       = "unix"
	unixNano   = "unixnano"
	rfc3339    = "rfc3339"
	byReceived = "received"
	byRayID    = "rayids"
)
type Client struct {
	endpoint        string
	apiKey          string
	apiEmail        string
	sample          float64
	timestampFormat string
	fields          []string
	httpClient      *http.Client
	dest            io.Writer
	headers         http.Header
}
type Options struct {
	HTTPClient *http.Client
	Headers http.Header
	Dest io.Writer
	TimestampFormat string
	Sample float64
	Fields []string
}
type Meta struct {
	Count      int
	Duration   int64
	StatusCode int
	URL        string
}
func New(apiKey string, apiEmail string, options *Options) (*Client, error) {
	if apiKey == "" {
		return nil, errors.New("apiKey cannot be empty")
	}
	if apiEmail == "" {
		return nil, errors.New("apiEmail cannot be empty")
	}
	client := &Client{
		apiKey:     apiKey,
		apiEmail:   apiEmail,
		endpoint:   apiURL,
		httpClient: http.DefaultClient,
		dest:       os.Stdout,
		headers:    make(http.Header),
	}
	if options != nil {
		client.timestampFormat = options.TimestampFormat
		client.sample = options.Sample
		if options.Dest != nil {
			client.dest = options.Dest
		}
		if options.Fields != nil {
			client.fields = options.Fields
		}
	}
	return client, nil
}
func (c *Client) buildURL(zoneID string, params url.Values) (*url.URL, error) {
	endpointType := byReceived
	rayID := params.Get("rayid")
	if rayID != "" {
		endpointType = byRayID
		params.Del("rayid")
	}
	u, err := url.Parse(
		fmt.Sprintf("%s/zones/%s/logs/%s",
			c.endpoint,
			zoneID,
			endpointType,
		),
	)
	if err != nil {
		return nil, err
	}
	if endpointType == byRayID {
		u.Path = path.Join(u.Path, rayID)
	}
	if len(c.fields) >= 1 {
		params.Set("fields", strings.Join(c.fields, ","))
	}
	if endpointType != byRayID && c.sample != 0.0 {
		params.Set("sample", strconv.FormatFloat(c.sample, 'f', 3, 64))
	}
	if c.timestampFormat != "" {
		params.Set("timestamps", c.timestampFormat)
	}
	u.RawQuery = params.Encode()
	return u, nil
}