query

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filters

type Filters struct {
	Status      []common.Status
	Author      []string
	Metadata    []StringPair
	Actor       []string
	Participant []string
	Label       []string
	Title       []string
	NoLabel     bool
}

Filters is a collection of Filter that implement a complex filter

type OrderBy

type OrderBy int
const (
	OrderById OrderBy
	OrderByCreation
	OrderByEdit
)

type OrderDirection

type OrderDirection int
const (
	OrderAscending OrderDirection
	OrderDescending
)

type Query

type Query struct {
	Search
	Filters
	OrderBy
	OrderDirection
}

Query is the intermediary representation of a Bug's query. It is either produced by parsing a query string (ex: "status:open author:rene") or created manually. This query doesn't do anything by itself and need to be interpreted for the specific domain of application.

func NewQuery

func NewQuery() *Query

NewQuery return an identity query with the default sorting (creation-desc).

func Parse

func Parse(query string) (*Query, error)

Parse parse a query DSL

Ex: "status:open author:descartes sort:edit-asc"

Supported filter qualifiers and syntax are described in docs/queries.md

type Search []string

type StringPair added in v0.8.0

type StringPair struct {
	Key   string
	Value string
}

StringPair is a key/value pair of strings

Jump to

Keyboard shortcuts

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