apl

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package apl provides the datatypes for construction APL queries. They usually extend the functionality of existing types from the `query` package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format uint8

Format represents the format of an APL query.

const (
	Legacy Format = iota // legacy
)

All available query formats.

func (Format) EncodeValues

func (f Format) EncodeValues(key string, v *url.Values) error

EncodeValues implements `query.Encoder`. It is in place to encode the Format into a string URL value because that's what the server expects.

func (Format) String

func (i Format) String() string

type Options

type Options struct {
	// StartTime of the query.
	StartTime time.Time `url:"-"`
	// EndTime of the query.
	EndTime time.Time `url:"-"`

	// NoCache omits the query cache.
	NoCache bool `url:"nocache,omitempty"`
	// Save the query on the server, if set to `true`. The ID of the saved query
	// is returned with the query result as part of the response.
	// HINT(lukasmalkmus): The server automatically sets the query kind to "apl"
	// for queries going to the "/_apl" query endpoint. This allows us to set
	// any value for the `saveAsKind` query param. For user experience, we use a
	// bool here instead of forcing the user to set the value to `query.APL`.
	Save bool `url:"saveAsKind,omitempty"`
	// Format specifies the format of the APL query. Defaults to Legacy.
	Format Format `url:"format"`
}

Options specifies the optional parameters to APL query methods.

type Result

type Result struct {
	*query.Result

	// Request is the APL query request that created the result.
	Request *query.Query `json:"request"`
	// The datasets that were queried in order to create the result.
	Datasets []string `json:"datasetNames"`
}

Result is the result of an APL query. It adds the APL query request alongside the query result it created, making it a superset of `query.Result`

Jump to

Keyboard shortcuts

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