summaryrefslogtreecommitdiff
path: root/internal/regex
AgeCommit message (Collapse)Author
2026-01-29refactor: improve Go best practices compliancePaul Buetow
- Add explicit interface satisfaction checks (var _ Interface = (*Type)(nil)) for compile-time verification: - TurboWriter implementations (DirectTurboWriter, TurboChannelWriter) - Processor implementations (GrepLineProcessor, ChannellessLineProcessor) - Parser implementations (genericParser, csvParser, genericKVParser, custom parsers, mimecastParser) - Logger implementations (file, stdout) - Handler implementations (ServerHandler, ClientHandler) - Connector implementations (Serverless, ServerConnection) - SSH callback implementations (KnownHostsCallback) - Improve error handling with context wrapping (%w): - SSH operations: GeneratePrivateRSAKey, Agent - Query parsing: Query.parse - SSH client connections: dial, session, handle methods - Fix receiver consistency: - Convert Query.String() from value to pointer receiver - Convert Outfile.String() from value to pointer receiver - Convert all KnownHostsCallback methods to pointer receivers - Convert mapCommand.Start() to pointer receiver - Reorganize file structure for better clarity: - internal/io/dlog/dlog.go: Move type definition before public functions - internal/mapr/token.go: Reorganize helper functions after public ones - Add documentation comments: - Query.String() method - Outfile.String() method - Regex.String() method - Improve config variable documentation All unit tests and integration tests pass. Amp-Thread-ID: https://ampcode.com/threads/T-019c0b08-0eeb-705d-a1f7-31bb764b659a Co-authored-by: Amp <amp@ampcode.com>
2025-07-02feat: add server info message for literal grep modePaul Buetow
- Add IsLiteral() and Pattern() methods to regex.Regex struct - Log info message when grep uses optimized literal string matching - Fix bug where grep commands were processed as cat commands - Add comprehensive integration tests to verify literal mode messages This gives users visibility when the performance-optimized literal string matching is being used instead of regex matching. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-02perf: optimize grep for simple string matchingPaul Buetow
Add literal string detection to bypass regex compilation for patterns without metacharacters. This provides ~4x performance improvement for common grep patterns like "ERROR" or "WARNING". - Detect literal patterns (no regex metacharacters) at compile time - Use bytes.Contains/strings.Contains for literal matching - Maintain full backward compatibility and serialization format - Add comprehensive tests and benchmarks Benchmark results show: - Literal matching: 107.4 ns/op (optimized) - Regex matching: 439.2 ns/op (original) - Direct bytes.Contains: 88.51 ns/op (baseline) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2021-10-10vetting and linting and some code restylingPaul Buetow
2021-10-02move args to config packagePaul Buetow
logger package rewrite as dlog
2020-12-08merge developPaul Buetow
2020-09-10printing client stats every other second only if the connection count has ↵Paul Buetow
changed or when SIGUSR1 or SIGINFO recieved
2020-09-04fix regex bugPaul Buetow
2020-09-04server side support for new regex packagePaul Buetow
2020-09-04add more unit tests and deserializer/serializer to regexPaul Buetow
2020-08-30initial regex packagePaul Buetow