Documentation ¶
Overview ¶
Package gomeasure contains the business logic or the main logic of the software
This allows any driver (e.g. a CLI) to simply call functions to get things done. (Separation of concerns).
Index ¶
Constants ¶
View Source
const ( // MeasureFile counts the number of files in a project or directory MeasureFile measureAction = iota // MeasureLine counts the number of lines in a file MeasureLine // MeasureCharacter counts the number of characters in a file (files inside a folder) MeasureCharacter )
Variables ¶
This section is empty.
Functions ¶
func PrettyPrint ¶ added in v0.3.2
PrettyPrint prints rows of lines in a tabular format. Each line is a row and each column of line is separated by a tab.
Types ¶
type Config ¶ added in v0.3.1
type Config struct { // glob expression of files to be included on the command count process IncludedFiles string `json:"include"` // glob expression of files to be excluded on the command count process ExcludedFiles string `json:"exclude"` // bool value to weather to count empty lines in the command count process ShouldCountEmpty bool `json:"empty_lines"` // number of concurrent workers used to read files and count them WorkersCount int `json:"workers"` // IsVerbose determines if the program should print the progress of the command count process IsVerbose bool `json:"verbose"` }
Config is the configuration struct for gomeasure.
func NewConfig ¶ added in v0.3.1
func NewConfig() *Config
NewConfig returns a new Config with default values
func (*Config) UnmarshalJSON ¶ added in v0.3.1
type Result ¶
Result is the result of a single file count it contains the file path and the number of lines
type Runner ¶
type Runner struct { // the Directory to be processed Directory string // specifies whether to count files, lines or characters Action measureAction // Configurations that determine how the command count process should be performed *Config // contains filtered or unexported fields }
Runner is the main struct that processes the files in a folder
Click to show internal directories.
Click to hide internal directories.