rg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

nolint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Path           Text       `json:"path"`
	Lines          Text       `json:"lines"`
	LineNumber     int64      `json:"line_number"`
	AbsoluteOffset int64      `json:"absolute_offset"`
	Submatches     []Submatch `json:"submatches"`
	Stats          Stats      `json:"stats"`
}

type Elapsed

type Elapsed struct {
	Secs  int64  `json:"secs"`
	Nanos int64  `json:"nanos"`
	Human string `json:"human"`
}

type Line

type Line struct {
	Type string `json:"type"`
	Data Data   `json:"data"`
}

type Rg

type Rg struct {
	grep.Grep
}

func NewRg

func NewRg() *Rg

func (*Rg) Cmd

func (p *Rg) Cmd(query *pb.Query) (string, []string)

func (*Rg) Install

func (p *Rg) Install() error

func (*Rg) Search

func (p *Rg) Search(_ *pb.Query, reader *bufio.Reader, acks chan<- *pb.Ack)

type Stats

type Stats struct {
	Elapsed           Elapsed `json:"elapsed"`
	Searches          int64   `json:"searches"`
	SearchesWithMatch int64   `json:"searches_with_match"`
	BytesSearched     int64   `json:"bytes_searched"`
	BytesPrinted      int64   `json:"bytes_printed"`
	MatchedLines      int64   `json:"matched_lines"`
	Matches           int64   `json:"matches"`
}

type Submatch

type Submatch struct {
	Match Text  `json:"match"`
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

type Text

type Text struct {
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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