dorks

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

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