query

package
v0.0.0-...-2ad74da Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package query contains the logic involving parsing queries to Gold's search endpoints.

Index

Constants

View Source
const (
	// SortAscending indicates that we want to sort in ascending order.
	SortAscending = "asc"
	// SortDescending indicates that we want to sort in descending order.
	SortDescending = "desc"

	// CombinedMetric corresponds to diff.DiffMetric.CombinedMetric
	CombinedMetric = "combined"
	// PercentMetric corresponds to diff.DiffMetric.PixelDiffPercent
	PercentMetric = "percent"
	// PixelMetric corresponds to diff.DiffMetric.NumDiffPixels
	PixelMetric = "pixel"
)

Variables

This section is empty.

Functions

func ParseSearch

func ParseSearch(r *http.Request, q *Search) error

ParseSearch parses the request parameters from the URL query string or from the form parameters and stores the parsed and validated values in query.

Types

type Search struct {
	// Diff metric to use.
	Metric string
	Sort   string
	Match  []string

	// Blaming
	BlameGroupID string

	// Image classification
	IncludePositiveDigests           bool
	IncludeNegativeDigests           bool
	IncludeUntriagedDigests          bool
	OnlyIncludeDigestsProducedAtHead bool
	IncludeIgnoredTraces             bool

	// URL encoded query string
	QueryStr    string
	TraceValues paramtools.ParamSet
	// Not given to us by the frontend yet.
	OptionsValues paramtools.ParamSet

	// URL encoded query string to select the right hand side of comparisons.
	RightQueryStr    string
	RightTraceValues paramtools.ParamSet

	// TryJob support.
	ChangelistID       string
	CodeReviewSystemID string
	// TODO(kjlubick) Change this so only one patchset is allowed. It will simplify the backend code.
	PatchsetsStr string // Comma-separated list of patchsets.
	Patchsets    []int64
	// By default, we typically only want to see digests that were created exclusively on this CL,
	// but sometimes the user wants to also see digests that are the same as on master, so this option
	// allows for that.
	IncludeDigestsProducedOnMaster bool

	// Filtering.
	RGBAMinFilter              int  // Min RGBA delta
	RGBAMaxFilter              int  // Max RGBA delta
	MustIncludeReferenceFilter bool // Only digests with reference.

	// Pagination.
	Offset int
	Limit  int
}

Search represents the params to the Search function.

func (*Search) ExcludesClassification

func (q *Search) ExcludesClassification(cl expectations.Label) bool

ExcludesClassification returns true if the given label/status for a digest should be excluded based on the values in the query.

func (*Search) IgnoreState

func (q *Search) IgnoreState() types.IgnoreState

IgnoreState returns the types.IgnoreState that this Search query is configured for.

Jump to

Keyboard shortcuts

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