dorks

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

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  Keyword  `parser:"@(Time | Float | Int | Phrase | Keyword)" json:"keyword,omitzero"`
	Match    *Match   `parser:"@@?" json:"match,omitzero"`
	Boost    *float64 `parser:"(';' @(Float | Int))?" json:"boost,omitzero"`
	Fuzzy    *int     `parser:"('~' @Int)?" json:"fuzzy,omitzero"`
}

type Float

type Float struct {
	Value float64
}

func (*Float) Capture

func (f *Float) Capture(values []string) (err error)

type Integer

type Integer struct {
	Value int64
}

func (*Integer) Capture

func (i *Integer) Capture(values []string) (err error)

type Keyword

type Keyword string

func (*Keyword) Capture

func (k *Keyword) Capture(values []string) (err error)

type Match

type Match struct {
	Operator MatchOperator `parser:"':' @MatchOperator?" json:"operator,omitzero"`
	Date     *Time         `parser:"(@Time" json:"date,omitzero"`
	Float    *Float        `parser:"| @Float" json:"float,omitzero"`
	Integer  *Integer      `parser:"| @Int" json:"integer,omitzero"`
	Keyword  *string       `parser:"| @(Keyword | Phrase))" json:"keyword,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(defTokenizer tokenizer.Tokenizer, fieldsTokenizer map[uint64]tokenizer.Tokenizer) (sq *query.SimpleQuery)

type Time

type Time struct {
	Value time.Time
}

func (*Time) Capture

func (t *Time) Capture(values []string) (err error)

Jump to

Keyboard shortcuts

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