Documentation
¶
Overview ¶
Package queryclient reads canonical analytics from a TokenInsights server.
Index ¶
- Variables
- func DescriptorCapabilities(descriptor api.InstanceResponseV2) serverfeatures.Capabilities
- func HasPermission(descriptor api.InstanceResponseV2, permission serverfeatures.Permission) bool
- type Client
- func (c *Client) AllUsage(ctx context.Context, params api.GetUsageParams) (api.UsageResponseV2, error)
- func (c *Client) Descriptor(ctx context.Context) (api.InstanceResponseV2, error)
- func (c *Client) Facets(ctx context.Context, params api.GetUsageFacetsParams) (api.UsageFacetsResponseV2, error)
- func (c *Client) Instance(ctx context.Context) (api.InstanceResponseV2, error)
- func (c *Client) Status(ctx context.Context) (api.StatusResponseV2, error)
- func (c *Client) Usage(ctx context.Context, params api.GetUsageParams) (api.UsageResponseV2, error)
- func (c *Client) WithDataset(dataset string) *Client
- func (c *Client) WithToken(token string) *Client
- type Reader
- type StatusError
Constants ¶
This section is empty.
Variables ¶
var ErrSnapshotChanged = errors.New("server analytics changed during pagination; retry")
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 ¶
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 (*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 (*Client) Facets ¶
func (c *Client) Facets(ctx context.Context, params api.GetUsageFacetsParams) (api.UsageFacetsResponseV2, error)
func (*Client) Status ¶
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 ¶
WithDataset pins reads to one authenticated dataset for every read.
type Reader ¶
type Reader interface {
Instance(context.Context) (api.InstanceResponseV2, error)
Usage(context.Context, api.GetUsageParams) (api.UsageResponseV2, error)
AllUsage(context.Context, api.GetUsageParams, int) (api.UsageResponseV2, error)
Facets(context.Context, api.GetUsageFacetsParams) (api.UsageFacetsResponseV2, error)
Status(context.Context) (api.StatusResponseV2, error)
}
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