state

package
v0.0.0-...-97d4441 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Errs

type Errs struct {
	Mtx  sync.Mutex
	Vals []error
}

Errs represents an error store.

func (*Errs) Add

func (errs *Errs) Add(err error)

Add adds a given error. Same error is returned.

func (*Errs) Get

func (errs *Errs) Get() []error

Get returns the store's errors. Store is then cleared.

type Hit

type Hit struct {
	Path string
	Meta *hit.Meta
}

Hit represents a hit detection.

type Job

type Job struct {
	WGrp  *sync.WaitGroup
	Count int       `json:"count"`
	Hits  chan *Hit `json:"-"`
	// contains filtered or unexported fields
}

Job represents a job state.

func NewJob

func NewJob() *Job

NewJob returns a job.

func (*Job) AddErr

func (job *Job) AddErr(err error)

AddErr adds error to given job.

func (*Job) Errs

func (job *Job) Errs() []error

Errs returns given job's errs.

type Paths

type Paths map[string]*hit.Meta

Paths represents hit meta per path.

type Result

type Result struct {
	Target string
	Paths  Paths
	// contains filtered or unexported fields
}

Result represents a target's hits.

func Group

func Group(target string, hits []*Hit) []*Result

Group returns a slice of results from given slice of hits.

func NewResult

func NewResult(target string, paths Paths) *Result

NewResult returns a result. Errs is created.

func (*Result) AddErr

func (result *Result) AddErr(err error)

AddErr adds error to given result.

func (*Result) Errs

func (result *Result) Errs() []error

Errs returns given result's errs.

func (*Result) Log

func (result *Result) Log() error

Log logs given result's hits.

func (*Result) Print

func (result *Result) Print() error

Print prints given result's hits.

func (*Result) Save

func (result *Result) Save(db *bbolt.DB) error

Save saves given result's hits to given db.

Jump to

Keyboard shortcuts

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