lwc

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CARRIAGE_RETURN byte = 13
View Source
const COUNT_FORMAT string = "%8d"
View Source
const DEFAULT_INTERVAL int = 100
View Source
const LINE_FEED byte = 10
View Source
const SPACE byte = 32

Variables

This section is empty.

Functions

func FormatCounts

func FormatCounts(counts *[]uint64, name string, cr bool, lf bool) *bytes.Buffer

func OpenFile added in v0.4.0

func OpenFile(namePtr *string) (string, *os.File)

func PollCounts

func PollCounts(name string, counts *[]uint64, interval time.Duration, done chan bool)

func PrintCounts

func PrintCounts(counts *[]uint64, name string, cr bool, lf bool)

func ProcessFile

func ProcessFile(namePtr *string, processors []Processor, totals *[]uint64, interval time.Duration)

func ProcessFiles

func ProcessFiles(config *Config)

func ProcessReader

func ProcessReader(reader io.Reader, processor Processor, count *uint64, total *uint64)

func Run

func Run(version string)

func ScanCount

func ScanCount(scanner *bufio.Scanner, count *uint64, total *uint64)

func ScanMaxLength

func ScanMaxLength(scanner *bufio.Scanner, count *uint64, total *uint64)

Types

type Config

type Config struct {
	Lines         bool
	Words         bool
	Chars         bool
	Bytes         bool
	MaxLineLength bool
	Files0From    string
	Interval      time.Duration
	Help          bool
	Version       bool
	Files         []string
	// contains filtered or unexported fields
}

func NewConfig added in v0.4.0

func NewConfig(args []string) *Config

func (*Config) FilesChan added in v0.4.0

func (config *Config) FilesChan() *chan string

func (*Config) PrintUsage

func (c *Config) PrintUsage()

func (*Config) Processors added in v0.4.0

func (config *Config) Processors() []Processor

type Processor

type Processor struct {
	Split bufio.SplitFunc
	Scan  ScanFunc
}

type ScanFunc

type ScanFunc func(*bufio.Scanner, *uint64, *uint64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL