search

package
v42.0.0-...-56f38d9 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package search contains all the required functions to find work items Following different patterns and filter options.

Index

Constants

View Source
const (
	HostRegistrationKeyForListWI  = "work-item-list-details"
	HostRegistrationKeyForBoardWI = "work-item-board-details"

	Q_EQ  = "$EQ"
	Q_NE  = "$NE"
	Q_AND = "$AND"
	Q_OR  = "$OR"
	Q_NOT = "$NOT"
	Q_IN  = "$IN"
)

KnownURL registration key constants

Variables

This section is empty.

Functions

func GetAllRegisteredURLs

func GetAllRegisteredURLs() map[string]KnownURL

GetAllRegisteredURLs returns all known URLs

func RegisterAsKnownURL

func RegisterAsKnownURL(name, urlRegex string)

RegisterAsKnownURL appends to KnownURLs

Types

type GormSearchRepository

type GormSearchRepository struct {
	// contains filtered or unexported fields
}

GormSearchRepository provides a Gorm based repository

func NewGormSearchRepository

func NewGormSearchRepository(db *gorm.DB) *GormSearchRepository

NewGormSearchRepository creates a new search repository

func (*GormSearchRepository) Filter

func (r *GormSearchRepository) Filter(ctx context.Context, rawFilterString string, parentExists *bool, start *int, limit *int) ([]workitem.WorkItem, uint64, error)

Filter Search returns work items for the given query

func (*GormSearchRepository) SearchFullText

func (r *GormSearchRepository) SearchFullText(ctx context.Context, rawSearchString string, start *int, limit *int, spaceID *string) ([]workitem.WorkItem, uint64, error)

SearchFullText Search returns work items for the given query

type KnownURL

type KnownURL struct {
	URLRegex string // regex for URL, Exposed to make the code testable
	// contains filtered or unexported fields
}

KnownURL has a regex string format URL and compiled regex for the same

type Query

type Query struct {
	// Name can contain a field name to search for (e.g. "space") or one of the
	// binary operators "$AND", or "$OR". If the Name is not an operator, we
	// compare the Value against a column in the database that maps to this
	// Name. We check the Value for equality and for inequality if the Negate
	// field is set to true.
	Name string
	// Operator nodes, with names "$AND", "$OR" etc. will not have values.
	// Since this struct represents tail nodes as well as these operator nodes,
	// the pointer is more suitable.
	Value *string
	// When Negate is true the comparison desribed above is negated; hence we
	// check for inequality. When Name is an operator, the Negate field has no
	// effect.
	Negate bool
	// A Query is expected to have child queries only if the Name field contains
	// an operator like "$AND", or "$OR". If the Name is not an operator, the
	// Children slice MUST be empty.
	Children []Query
}

Query represents tree structure of the filter query

Jump to

Keyboard shortcuts

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