Documentation ¶
Overview ¶
Package search contains all the required functions to find work items Following different patterns and filter options.
Index ¶
- Constants
- func GetAllRegisteredURLs() map[string]KnownURL
- func RegisterAsKnownURL(name, urlRegex string)
- type GormSearchRepository
- func (r *GormSearchRepository) Filter(ctx context.Context, rawFilterString string, parentExists *bool, start *int, ...) ([]workitem.WorkItem, uint64, error)
- func (r *GormSearchRepository) SearchFullText(ctx context.Context, rawSearchString string, start *int, limit *int, ...) ([]workitem.WorkItem, uint64, error)
- type KnownURL
- type Query
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 ¶
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
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
Click to show internal directories.
Click to hide internal directories.