dorks

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AllFieldNone = 0

Variables

This section is empty.

Functions

func PickTokenizer

func PickTokenizer(defTokenizer tokenizer.Tokenizer, fieldsTokenizer map[uint64]tokenizer.Tokenizer, fieldHash uint64) (toknizer tokenizer.Tokenizer)

func TokenizeOrPushValue

func TokenizeOrPushValue(tok tokenizer.Tokenizer, value []byte) (seq iter.Seq[*tokenizer.Token])

Types

type Dork

type Dork struct {
	Operator Operator       `parser:"@( '+' | '-')?" json:"operator,omitzero"`
	Keyword  UnquotedString `parser:"@(Time | Float | Int | Phrase | Keyword | Phrase)" json:"keyword,omitzero"`
	Match    *Match         `parser:"@@?" json:"match,omitzero"`
	Boost    *float32       `parser:"(';' @(Float | Int))?" json:"boost,omitzero"`
	Fuzzy    *int           `parser:"('~' @Int)?" json:"fuzzy,omitzero"`
}

type Match

type Match struct {
	Operator MatchOperator  `parser:"':' @MatchOperator?" json:"operator,omitzero"`
	Value    UnquotedString `parser:"@(Time | Float | Int | Keyword | Phrase)" json:"date,omitzero"`
}

type MatchOperator

type MatchOperator uint8
const (
	MatchOperatorNone MatchOperator = iota
	MatchOperatorGreaterEqual
	MatchOperatorLessEqual
	MatchOperatorGreater
	MatchOperatorLess
)

func (*MatchOperator) Capture

func (o *MatchOperator) Capture(values []string) (err error)

type Operator

type Operator uint8
const (
	OperatorNone Operator = iota
	OperatorMust
	OperatorMustNot
)

func (*Operator) Capture

func (o *Operator) Capture(values []string) (err error)

type Query

type Query struct {
	Dorks []*Dork `parser:"@@*"`
}

func Parse

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

func (*Query) Compile

func (q *Query) Compile(allField uint64, defTokenizer tokenizer.Tokenizer, fieldsTokenizer map[uint64]tokenizer.Tokenizer) (sq *query.SimpleQuery)

The all field permits dorks to focus search on a specific field when keywords are received without field

type UnquotedString added in v1.4.0

type UnquotedString string

func (*UnquotedString) Capture added in v1.4.0

func (v *UnquotedString) Capture(values []string) (err error)

Jump to

Keyboard shortcuts

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