Documentation ¶
Overview ¶
Package chapter7, Interfaces, defines bytes, words and line counter writer interfaces that can be used as part of fmt methods.
Index ¶
- func CelsiusFlag(name string, value tempConv.Celsius, usage string, set *flag.FlagSet) *tempConv.Celsius
- func CountCharsWordsLines(r io.Reader) (int, int, int)
- func CountingWriter(w io.Writer) (io.Writer, *int64)
- func FahrenheitFlag(name string, value tempConv.Fahrenheit, usage string, set *flag.FlagSet) *tempConv.Fahrenheit
- func InitCli()
- func KelvinFlag(name string, value tempConv.Kelvin, usage string, set *flag.FlagSet) *tempConv.Kelvin
- type BroadcastWriters
- type ByteCounter
- type CLICounter
- type CLIDegrees
- type CountWriter
- type LineCounter
- type WordCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CelsiusFlag ¶
func CelsiusFlag(name string, value tempConv.Celsius, usage string, set *flag.FlagSet) *tempConv.Celsius
CelsiusFlag creates a custom flag
func CountCharsWordsLines ¶
CountCharsWordsLines reads from a reader and returns count of
characters words and lines
func CountingWriter ¶
CountingWriter intercept a writer and count bytes written to it
func FahrenheitFlag ¶
func FahrenheitFlag(name string, value tempConv.Fahrenheit, usage string, set *flag.FlagSet) *tempConv.Fahrenheit
FahrenheitFlag creates a custom flag
Types ¶
type BroadcastWriters ¶
type BroadcastWriters struct {
// contains filtered or unexported fields
}
BroadcastWriters sequentially writes to writers in linked list
func NewBroadcastWriters ¶
func NewBroadcastWriters(writers ...io.Writer) *BroadcastWriters
NewBroadcastWriters creates a broadcast list of Writers
type ByteCounter ¶
type ByteCounter int
ByteCounter writer interface counts number of bytes written to it
type CLICounter ¶
type CLICounter struct {
// contains filtered or unexported fields
}
CLICounter wrapper for *flag.FlagSet for CountCharsWordsLines
func (CLICounter) DisplayHelp ¶
func (t CLICounter) DisplayHelp()
type CLIDegrees ¶
type CLIDegrees struct {
// contains filtered or unexported fields
}
CLIDegrees wrapper for *flag.FlagSet for tempConv
func (CLIDegrees) DisplayHelp ¶
func (t CLIDegrees) DisplayHelp()
type CountWriter ¶
type CountWriter struct {
// contains filtered or unexported fields
}
CountWriter intercepts an io.Writer and counts numbers of characters written to it
type LineCounter ¶
type LineCounter int
LineCounter writer interface counts number of lines written to it
type WordCounter ¶
type WordCounter int
WordCounter writer interface counts number of words written to it