Grep Search

Provides a mechanism for searching with ripgrep

Technology

The grep module provides fast text search capabilities for Project Forge applications using the high-performance ripgrep command-line tool.

Overview

This module enables applications to perform blazing-fast text searches across files and directories by wrapping the ripgrep utility in a convenient Go API. It’s particularly useful for:

Key Features

Performance

Search Capabilities

Integration

Package Structure

Core Library

API Overview

Basic Usage

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import "github.com/yourproject/app/lib/grep"

// Create a search request
req := &grep.Request{
Query: "func.*Handler",
Directory: "./app",
CaseSensitive: false,
}

// Execute the search
response, err := grep.Run(req)
if err != nil {
return err
}

// Process results
for _, match := range response.Matches {
fmt.Printf("%s:%d: %s\n", match.File, match.LineNumber, match.Line)
}

Search Configuration

The module supports extensive search customization:

Requirements

System Dependencies

Runtime Dependencies

Source Code

See Also