grep

package module
v0.0.0-...-c39192d Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

go-grep

Coverage GoDoc Lint and Test Status CodeQL analisys Status Go Report Card

go-grep is a simple library for replacing grep functionality written in pure go

Limitations

Time tests

Time

Documentation

Index

Constants

View Source
const GouroutinesLimit = 512

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name  string
	Lines []*Line
}

type GetMapper

type GetMapper interface {
	GetMap() []*File
}

type Line

type Line struct {
	Number int
	Text   string
}

type MapFiles

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

func MakeMapFiles

func MakeMapFiles() *MapFiles

func (*MapFiles) Delete

func (m *MapFiles) Delete(key any)

func (*MapFiles) Get

func (m *MapFiles) Get(key any) (value any, ok bool)

func (*MapFiles) GetStruct

func (m *MapFiles) GetStruct() []*File

func (*MapFiles) Len

func (m *MapFiles) Len() int

func (*MapFiles) Pop

func (m *MapFiles) Pop(key any) (value any, loaded bool)

func (*MapFiles) Put

func (m *MapFiles) Put(key, value any)

func (*MapFiles) Range

func (m *MapFiles) Range(f func(key, value any) bool)

type StringFinder

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

func MakeStringFinder

func MakeStringFinder(pattern string) *StringFinder

func (*StringFinder) Search

func (f *StringFinder) Search(path string, onlyFiles bool) (*MapFiles, error)

func (*StringFinder) SetGouroutinesLimit

func (f *StringFinder) SetGouroutinesLimit(limit int)

type SyncMap

type SyncMap interface {
	Delete(key any)
	Get(key any) (value any, ok bool)
	Pop(key any) (value any, loaded bool)
	Put(key, value any)
	Len() int
	Range(f func(key, value any) bool)
}

func MakeLinesWithText

func MakeLinesWithText() SyncMap

func MakeOnlyFiles

func MakeOnlyFiles() SyncMap

Jump to

Keyboard shortcuts

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