Documentation
¶
Index ¶
- type FileInfo
- type Formatter
- func (f *Formatter) AddFile(fileInfo FileInfo)
- func (f *Formatter) GetFormattedContent() (string, error)
- func (f *Formatter) SetFileTypes(fileTypes map[string]int)
- func (f *Formatter) SetHeaderContent(content string)
- func (f *Formatter) SetIssues(issues []string)
- func (f *Formatter) SetKeyFiles(keyFiles []string)
- func (f *Formatter) SetProjectStructure(structure string)
- func (f *Formatter) SetStatistics(fileCount int, totalSize int64, tokenCount, charCount int, ...)
- func (f *Formatter) SetTechnologies(technologies []string)
- func (f *Formatter) WriteToFile() (string, error)
- func (f *Formatter) WriteToStdout() error
- type OutputFormat
- type ProjectReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter handles formatting output in different formats
func NewFormatter ¶
NewFormatter creates a new formatter for the specified format
func (*Formatter) GetFormattedContent ¶
GetFormattedContent returns the formatted content as a string
func (*Formatter) SetFileTypes ¶
SetFileTypes sets the file types in the report
func (*Formatter) SetHeaderContent ¶
SetHeaderContent sets the header content for the report
func (*Formatter) SetKeyFiles ¶
SetKeyFiles sets the key files in the report
func (*Formatter) SetProjectStructure ¶
SetProjectStructure sets the project structure for the report
func (*Formatter) SetStatistics ¶
func (f *Formatter) SetStatistics(fileCount int, totalSize int64, tokenCount, charCount int, duration time.Duration)
SetStatistics sets the statistics for the report
func (*Formatter) SetTechnologies ¶
SetTechnologies sets the technologies in the report
func (*Formatter) WriteToFile ¶
WriteToFile writes the formatted output to a file
func (*Formatter) WriteToStdout ¶
WriteToStdout writes the formatted output to stdout
type OutputFormat ¶
type OutputFormat string
OutputFormat represents the format of the output file
const ( FormatTXT OutputFormat = "txt" FormatJSON OutputFormat = "json" FormatXML OutputFormat = "xml" FormatSTDOUT OutputFormat = "stdout" // Format pour sortie directe sur stdout )
type ProjectReport ¶
type ProjectReport struct {
ProjectInfo struct {
Name string `json:"name" xml:"name"`
GeneratedAt time.Time `json:"generated_at" xml:"generated_at"`
Generator string `json:"generator" xml:"generator"`
Host string `json:"host" xml:"host"`
OS string `json:"os" xml:"os"`
} `json:"project_info" xml:"project_info"`
Technologies []string `json:"technologies" xml:"technologies>technology"`
KeyFiles []string `json:"key_files" xml:"key_files>file"`
Issues []string `json:"issues" xml:"issues>issue"`
Statistics struct {
FileCount int `json:"file_count" xml:"file_count"`
TotalSize int64 `json:"total_size" xml:"total_size"`
TotalSizeHuman string `json:"total_size_human" xml:"total_size_human"`
AvgFileSize int64 `json:"avg_file_size" xml:"avg_file_size"`
TokenCount int `json:"token_count" xml:"token_count"`
CharCount int `json:"char_count" xml:"char_count"`
FilesPerSecond float64 `json:"files_per_second" xml:"files_per_second"`
} `json:"statistics" xml:"statistics"`
FileTypes []struct {
Extension string `json:"extension" xml:"extension,attr"`
Count int `json:"count" xml:"count"`
} `json:"file_types" xml:"file_types>type"`
Files []struct {
Path string `json:"path" xml:"path"`
Size int64 `json:"size" xml:"size"`
Content string `json:"content,omitempty" xml:"content,omitempty"`
Language string `json:"language" xml:"language"`
} `json:"files" xml:"files>file"`
}
ProjectReport represents the structure for formatted output