Help us shape the future of Go! Take the 2026 Go Developer Survey

queryclient

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package queryclient reads canonical analytics from a TokenInsights server.

Index

Constants

This section is empty.

Variables

View Source
var ErrSnapshotChanged = errors.New("server analytics changed during pagination; retry")
View Source
var ErrUnavailable = errors.New("server analytics unavailable")

Functions

func DescriptorCapabilities

func DescriptorCapabilities(descriptor api.InstanceResponseV2) serverfeatures.Capabilities

func HasPermission

func HasPermission(descriptor api.InstanceResponseV2, permission serverfeatures.Permission) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(baseURL string, httpClient *http.Client) (*Client, error)

New accepts an HTTP(S) origin or path prefix without URL credentials or queries. A copied client gets a bounded timeout and never follows redirects.

func NewDirect

func NewDirect(reader Reader) *Client

func (*Client) AllUsage

func (c *Client) AllUsage(ctx context.Context, params api.GetUsageParams) (api.UsageResponseV2, error)

AllUsage returns every row from one publication revision. Summary, chart, coverage, and other full-filter metadata retain the first page's values. Page is 1 and PageSize remains the requested server page size (200).

func (*Client) Descriptor

func (c *Client) Descriptor(ctx context.Context) (api.InstanceResponseV2, error)

func (*Client) Facets

func (*Client) Instance

func (c *Client) Instance(ctx context.Context) (api.InstanceResponseV2, error)

func (*Client) Status

func (c *Client) Status(ctx context.Context) (api.StatusResponseV2, error)

Status observes published data readiness and revision without requesting work.

func (*Client) Usage

func (c *Client) Usage(ctx context.Context, params api.GetUsageParams) (api.UsageResponseV2, error)

func (*Client) WithDataset

func (c *Client) WithDataset(dataset string) *Client

WithDataset pins reads to one authenticated dataset for every read.

func (*Client) WithToken

func (c *Client) WithToken(token string) *Client

WithToken returns a client copy authenticated by a bearer token.

type Reader

Reader is the query contract shared by network and in-process compositions. Each response describes a consistent publication snapshot.

type StatusError

type StatusError struct{ StatusCode int }

StatusError exposes only the HTTP status, never remote response text or URLs.

func (*StatusError) Error

func (e *StatusError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL