Documentation
¶
Index ¶
- Variables
- type Config
- type FileProcessor
- type FileProcessorOption
- func WithDelimiterType(delimiterType string) FileProcessorOption
- func WithFileFilter(filter *filefilter.FileFilter) FileProcessorOption
- func WithListOnly(listOnly bool) FileProcessorOption
- func WithMaxLines(maxLines int) FileProcessorOption
- func WithMaxTokens(maxTokens int) FileProcessorOption
- func WithMaxTotalSize(size int64) FileProcessorOption
- func WithPrintFilters(printFilters bool) FileProcessorOption
- func WithProcessor(processor middlewares.Processor) FileProcessorOption
- type FileStats
- type OutputFlag
- type Stats
- func (s *Stats) AddFile(path string, stats FileStats)
- func (s *Stats) ComputeStats(paths []string, filter *filefilter.FileFilter) error
- func (s *Stats) GetStats(path string) (FileStats, bool)
- func (s *Stats) PrintDirStructure()
- func (s *Stats) PrintFullStructure()
- func (s *Stats) PrintOverview()
- func (s *Stats) PrintStats(config Config, processor middlewares.Processor) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxTokensExceeded = errors.New("maximum total tokens limit reached") ErrMaxTotalSizeExceeded = errors.New("maximum total size limit reached") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
OutputFlags OutputFlag
}
type FileProcessor ¶
type FileProcessor struct { MaxTotalSize int64 TotalSize int64 TotalTokens int FileCount int TokenCounter *tiktoken.Tiktoken TokenCounts map[string]int ListOnly bool DelimiterType string MaxLines int MaxTokens int Filter *filefilter.FileFilter PrintFilters bool Processor middlewares.Processor Stats *Stats }
func NewFileProcessor ¶
func NewFileProcessor(options ...FileProcessorOption) *FileProcessor
func (*FileProcessor) ProcessPaths ¶
func (fp *FileProcessor) ProcessPaths(paths []string) error
type FileProcessorOption ¶
type FileProcessorOption func(*FileProcessor)
func WithDelimiterType ¶
func WithDelimiterType(delimiterType string) FileProcessorOption
func WithFileFilter ¶
func WithFileFilter(filter *filefilter.FileFilter) FileProcessorOption
func WithListOnly ¶
func WithListOnly(listOnly bool) FileProcessorOption
func WithMaxLines ¶
func WithMaxLines(maxLines int) FileProcessorOption
func WithMaxTokens ¶
func WithMaxTokens(maxTokens int) FileProcessorOption
func WithMaxTotalSize ¶
func WithMaxTotalSize(size int64) FileProcessorOption
func WithPrintFilters ¶
func WithPrintFilters(printFilters bool) FileProcessorOption
func WithProcessor ¶
func WithProcessor(processor middlewares.Processor) FileProcessorOption
type OutputFlag ¶
type OutputFlag int
const ( OutputOverview OutputFlag = 1 << iota OutputDirStructure OutputFullStructure )
type Stats ¶
type Stats struct { Files map[string]FileStats FileTypes map[string]FileStats Dirs map[string]FileStats DirFiles map[string][]string // New field to store files per directory Total FileStats // contains filtered or unexported fields }
func (*Stats) ComputeStats ¶
func (s *Stats) ComputeStats(paths []string, filter *filefilter.FileFilter) error
func (*Stats) PrintDirStructure ¶
func (s *Stats) PrintDirStructure()
func (*Stats) PrintFullStructure ¶
func (s *Stats) PrintFullStructure()
func (*Stats) PrintOverview ¶
func (s *Stats) PrintOverview()
func (*Stats) PrintStats ¶
func (s *Stats) PrintStats(config Config, processor middlewares.Processor) error
Click to show internal directories.
Click to hide internal directories.