Documentation
¶
Index ¶
- Variables
- type ClocFile
- type ClocFiles
- type ClocLanguage
- type ClocOptions
- type DefinedLanguages
- type JSONFilesResult
- type JSONLanguagesResult
- type Language
- type Languages
- type MultiLine
- type Processor
- type Result
- type XMLResult
- type XMLResultFiles
- type XMLResultLanguages
- type XMLResultType
- type XMLTotalFiles
- type XMLTotalLanguages
Constants ¶
This section is empty.
Variables ¶
View Source
var Exts = map[string]string{}/* 201 elements not displayed */
Functions ¶
This section is empty.
Types ¶
type ClocFile ¶
type ClocFile struct {
Code int32 `xml:"code,attr" json:"code"`
Comments int32 `xml:"comment,attr" json:"comment"`
Blanks int32 `xml:"blank,attr" json:"blank"`
Name string `xml:"name,attr" json:"name"`
Lang string `xml:"language,attr" json"language"`
}
func AnalyzeFile ¶
func AnalyzeFile(filename string, language *Language, opts *ClocOptions) *ClocFile
func AnalyzeReader ¶
type ClocLanguage ¶
type ClocLanguage struct {
Name string `xml:"name,attr" json:"name,omitempty"`
FilesCount int32 `xml:"files_count,attr" json:"files"`
Code int32 `xml:"code,attr" json:"code"`
Comments int32 `xml:"comment,attr" json:"comment"`
Blanks int32 `xml:"blank,attr" json:"blank"`
}
ClocLanguage is provide for xml-cloc and json format
type ClocOptions ¶
type ClocOptions struct {
Debug bool
SkipDuplicated bool
ExcludeExts map[string]struct{}
IncludeLangs map[string]struct{}
ReNotMatchDir *regexp.Regexp
ReMatchDir *regexp.Regexp
// OnCode is triggered for each line of code.
OnCode func(line string)
// OnBlack is triggered for each blank line.
OnBlank func(line string)
// OnComment is triggered for each line of comments.
OnComment func(line string)
}
func NewClocOptions ¶
func NewClocOptions() *ClocOptions
type DefinedLanguages ¶
func NewDefinedLanguages ¶
func NewDefinedLanguages() *DefinedLanguages
func (*DefinedLanguages) GetFormattedString ¶
func (langs *DefinedLanguages) GetFormattedString() string
type JSONFilesResult ¶
type JSONFilesResult struct {
Files []ClocFile `json:"files"`
Total ClocLanguage `json:"total"`
}
func NewJSONFilesResultFromCloc ¶
func NewJSONFilesResultFromCloc(total *Language, sortedFiles ClocFiles) JSONFilesResult
type JSONLanguagesResult ¶
type JSONLanguagesResult struct {
Languages []ClocLanguage `json:"languages"`
Total ClocLanguage `json:"total"`
}
func NewJSONLanguagesResultFromCloc ¶
func NewJSONLanguagesResultFromCloc(total *Language, sortedLanguages Languages) JSONLanguagesResult
type Language ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor(langs *DefinedLanguages, options *ClocOptions) *Processor
type XMLResult ¶
type XMLResult struct {
XMLName xml.Name `xml:"results"`
XMLFiles *XMLResultFiles `xml:"files,omitempty"`
XMLLanguages *XMLResultLanguages `xml:"languages,omitempty"`
}
func NewXMLResultFromCloc ¶
func NewXMLResultFromCloc(total *Language, sortedLanguages Languages, option XMLResultType) *XMLResult
type XMLResultFiles ¶
type XMLResultFiles struct {
Files []ClocFile `xml:"file"`
Total XMLTotalFiles `xml:"total"`
}
type XMLResultLanguages ¶
type XMLResultLanguages struct {
Languages []ClocLanguage `xml:"language"`
Total XMLTotalLanguages `xml:"total"`
}
type XMLResultType ¶
type XMLResultType int8
const ( XMLResultWithLangs XMLResultType = iota XMLResultWithFiles )
type XMLTotalFiles ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.