query

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package query implements search query parsing and matching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Match

type Match [2]int

Match is an array of [start, end] indexes for a match.

type Query

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

Query is a search query.

func Parse

func Parse(queryStr string) Query

Parse parses a search query string.

func (Query) FindAllIndex

func (q Query) FindAllIndex(b []byte) []Match

FindAllIndex returns a slice of all query match indexes in b.

func (Query) Match

func (q Query) Match(pathStr string, b []byte) bool

Match reports whether b matches the query.

func (Query) Score

func (q Query) Score(pathStr string, b []byte) float64

Score scores the query match against b.

Jump to

Keyboard shortcuts

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