Documentation ¶
Index ¶
- func ConvertToSliceOfString(input [][]interface{}) [][]string
- func DiscoverIgnoreFile() []string
- func ToAbsolutePath(path string) string
- type CountBody
- type DirCounter
- func (dc *DirCounter) Count() error
- func (dc *DirCounter) EnableTotal()
- func (dc *DirCounter) ExportCSV(filename ...string) (string, error)
- func (dc *DirCounter) ExportExcel(filename ...string) error
- func (dc *DirCounter) ExportTable() string
- func (dc *DirCounter) GetHeaderAndRows() []Row
- func (dc *DirCounter) GetRows() []Row
- func (dc *DirCounter) Ignore(pattern string)
- func (dc *DirCounter) IsIgnored(filename string) bool
- type Exporter
- type FileCounter
- func (fc *FileCounter) Count() error
- func (fc *FileCounter) ExportCSV(filename ...string) (string, error)
- func (fc *FileCounter) ExportExcel(filename ...string) error
- func (fc *FileCounter) ExportTable() string
- func (fc *FileCounter) GetHeader() Row
- func (fc *FileCounter) GetHeaderAndRow() []Row
- func (fc *FileCounter) GetRow() Row
- type Row
- type Stats
- type TabularExporter
- type TextCounter
- type WordCounterServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSliceOfString ¶
func ConvertToSliceOfString(input [][]interface{}) [][]string
func DiscoverIgnoreFile ¶
func DiscoverIgnoreFile() []string
func ToAbsolutePath ¶
ToAbsolutePath detects if a path is absolute or not. If not, it converts path to absolute.
Types ¶
type DirCounter ¶
type DirCounter struct { IgnoreList []string Fcs []*FileCounter Exporter *Exporter WithTotal bool // contains filtered or unexported fields }
func NewDirCounter ¶
func NewDirCounter(dirname string, ignores ...string) *DirCounter
func (*DirCounter) Count ¶
func (dc *DirCounter) Count() error
func (*DirCounter) EnableTotal ¶
func (dc *DirCounter) EnableTotal()
func (*DirCounter) ExportExcel ¶
func (dc *DirCounter) ExportExcel(filename ...string) error
func (*DirCounter) ExportTable ¶
func (dc *DirCounter) ExportTable() string
func (*DirCounter) GetHeaderAndRows ¶
func (dc *DirCounter) GetHeaderAndRows() []Row
func (*DirCounter) GetRows ¶
func (dc *DirCounter) GetRows() []Row
func (*DirCounter) Ignore ¶
func (dc *DirCounter) Ignore(pattern string)
func (*DirCounter) IsIgnored ¶
func (dc *DirCounter) IsIgnored(filename string) bool
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
func NewExporter ¶
func NewExporter() *Exporter
func (*Exporter) ExportTable ¶
type FileCounter ¶
type FileCounter struct { FileName string // contains filtered or unexported fields }
func NewFileCounter ¶
func NewFileCounter(filename string) *FileCounter
func (*FileCounter) Count ¶
func (fc *FileCounter) Count() error
func (*FileCounter) ExportCSV ¶
func (fc *FileCounter) ExportCSV(filename ...string) (string, error)
func (*FileCounter) ExportExcel ¶
func (fc *FileCounter) ExportExcel(filename ...string) error
func (*FileCounter) ExportTable ¶
func (fc *FileCounter) ExportTable() string
func (*FileCounter) GetHeader ¶
func (fc *FileCounter) GetHeader() Row
func (*FileCounter) GetHeaderAndRow ¶
func (fc *FileCounter) GetHeaderAndRow() []Row
func (*FileCounter) GetRow ¶
func (fc *FileCounter) GetRow() Row
type Stats ¶
type Stats struct { Lines int `json:"lines,omitempty"` ChineseChars int `json:"chinese_chars,omitempty"` NonChineseChars int `json:"non_chinese_chars,omitempty"` TotalChars int `json:"total_chars,omitempty"` }
func (*Stats) HeaderAndRows ¶
type TabularExporter ¶
type TextCounter ¶
type TextCounter struct {
S *Stats
}
func NewTextCounter ¶
func NewTextCounter() *TextCounter
func (*TextCounter) Count ¶
func (c *TextCounter) Count(input interface{}) error
type WordCounterServer ¶ added in v0.1.8
type WordCounterServer struct {
Srv *fiber.App
}
func NewWordCounterServer ¶ added in v0.1.8
func NewWordCounterServer() *WordCounterServer
func (*WordCounterServer) Count ¶ added in v0.1.8
func (s *WordCounterServer) Count(ctx *fiber.Ctx) error
func (*WordCounterServer) Run ¶ added in v0.1.8
func (s *WordCounterServer) Run(port int) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.