reader

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lines

type Lines struct {
	FileName  string
	LineNum   int // value -1 means scan the whole file and break after finding what we were looking for
	Condition func(line string) bool
	Parser    func(line string) (string, bool)
}

Lines represents line reader in a given 'FileName' immediately before the given 'LineNum'. Extraction happens when 'Condition' is met and being processed by 'Parser' function.

func (*Lines) Extract

func (l *Lines) Extract() ([]string, error)

Extract extracts lines in given file and based on the provided condition. returns empty if nothing found.

Jump to

Keyboard shortcuts

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