query

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: BSD-2-Clause Imports: 9 Imported by: 0

README

query

Package query parses the simple query language used for full text search in the Soquee issue tracker.

import (
	"code.soquee.net/query"
)

License

The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the LICENSE file.

Unless you explicitly state otherwise, any contribution submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.

Documentation

Overview

Package query is used to parse the simple query language used by Soquee.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IssueStatus

type IssueStatus int

IssueStatus represents the status of an issue (closed, open or any).

const (
	StatusAny IssueStatus = iota
	StatusClosed
	StatusOpen
)

A collection of issue statuses. Issues may be open or closed, and, in this special case "Any" which means "either of those".

type Query

type Query struct {
	Status   IssueStatus
	TSVector string
	Assignee string
	Limit    int
	Labels   []string
}

Query contains the parsed query string split into fields. This struct may grow over time and the field order is not part the package stability guarantee.

TSVector is a PostgreSQL compatible full text search string. It is not guaranteed to be safe from SQL injection and should always be parameterized.

func Bytes

func Bytes(q []byte) *Query

Bytes parses a query from a byte slice.

func Parse

func Parse(r io.Reader) (*Query, error)

Parse parses the query string from r and returns a parsed representation.

func String

func String(q string) *Query

String parses a query from a string.

Jump to

Keyboard shortcuts

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