Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 3.1% on proxy.golang.org
Top 0.4% dependent packages on proxy.golang.org
Top 0.6% dependent repos on proxy.golang.org
Top 7.1% forks on proxy.golang.org
Top 1.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/icza/backscanner

Package backscanner provides a scanner similar to bufio.Scanner, but it reads and returns lines in reverse order, starting at a given position (which may be the end of the input) and going backward. Unlike with bufio.Scanner, max line length may be configured. Advancing and accessing lines of the input is done by calling Scanner.Line(), which returns the next line (previous in the source) as a string. For maximum efficiency there is Scanner.LineBytes(). It returns the next line as a byte slice, which shares its backing array with the internal buffer of Scanner. This is because no copy is made from the line data; but this also means you can only inspect or search in the slice before calling Line() or LineBytes() again, as the content of the internal buffer–and thus slices returned by LineBytes()–may be overwritten. If you need to retain the line data, make a copy of it or use Line(). Example using it: Output: Using it to efficiently scan a file, finding last occurrence of a string ("error"):

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/icza/backscanner
Keywords: log, reverse, scanner
License: Apache-2.0
Latest release: about 1 year ago
First release: over 4 years ago
Namespace: github.com/icza
Dependent packages: 135
Dependent repositories: 105
Stars: 43 on GitHub
Forks: 8 on GitHub
Docker dependents: 11
Docker downloads: 12,915
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/icza
Last synced: 20 days ago

    Loading...
    Readme
    Loading...