Documentation ¶
Index ¶
- Variables
- func Debugf(fmt string, args ...interface{})
- func Errorf(fmt string, args ...interface{})
- func Printf(fmt string, args ...interface{})
- func Println(lines ...string)
- func Warnf(fmt string, args ...interface{})
- type CLI
- type ConsolePrinter
- func (c ConsolePrinter) Debugf(format string, args ...interface{})
- func (c ConsolePrinter) EndCorrection(err error)
- func (c ConsolePrinter) EndProvider(name string, numCorrections int, err error)
- func (c ConsolePrinter) Errorf(format string, args ...interface{})
- func (c ConsolePrinter) PrintCorrection(i int, correction *models.Correction)
- func (c ConsolePrinter) PrintReport(i int, correction *models.Correction)
- func (c ConsolePrinter) Printf(format string, args ...interface{})
- func (c ConsolePrinter) Println(lines ...string)
- func (c ConsolePrinter) PromptToRun() bool
- func (c ConsolePrinter) StartDNSProvider(provider string, skip bool)
- func (c ConsolePrinter) StartDomain(domain string)
- func (c ConsolePrinter) StartRegistrar(provider string, skip bool)
- func (c ConsolePrinter) Warnf(format string, args ...interface{})
- type Printer
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultPrinter is the default Printer, used by Debugf, Printf, and Warnf. DefaultPrinter = &ConsolePrinter{ Reader: bufio.NewReader(os.Stdin), Writer: os.Stdout, Verbose: false, } )
var SkinnyReport = true
SkinnyReport is true to to disable certain print statements. This is a hack until we have the new printer replacement. The long variable name is easy to grep for when we make the conversion.
Functions ¶
func Debugf ¶
func Debugf(fmt string, args ...interface{})
Debugf is called to print/format debug information.
func Errorf ¶
func Errorf(fmt string, args ...interface{})
Errorf is called to print/format an error.
Types ¶
type CLI ¶
type CLI interface { Printer StartDomain(domain string) StartDNSProvider(name string, skip bool) EndProvider(name string, numCorrections int, err error) StartRegistrar(name string, skip bool) PrintCorrection(n int, c *models.Correction) PrintReport(n int, c *models.Correction) // Print corrections that are diff2.REPORT EndCorrection(err error) PromptToRun() bool }
CLI is an abstraction around the CLI.
type ConsolePrinter ¶
ConsolePrinter is a handle for the console printer.
func (ConsolePrinter) Debugf ¶
func (c ConsolePrinter) Debugf(format string, args ...interface{})
Debugf is called to print/format debug information.
func (ConsolePrinter) EndCorrection ¶
func (c ConsolePrinter) EndCorrection(err error)
EndCorrection is called at the end of each correction.
func (ConsolePrinter) EndProvider ¶
func (c ConsolePrinter) EndProvider(name string, numCorrections int, err error)
EndProvider is called at the end of each provider.
func (ConsolePrinter) Errorf ¶
func (c ConsolePrinter) Errorf(format string, args ...interface{})
Errorf is called to print/format an error.
func (ConsolePrinter) PrintCorrection ¶
func (c ConsolePrinter) PrintCorrection(i int, correction *models.Correction)
PrintCorrection is called to print/format each correction.
func (ConsolePrinter) PrintReport ¶
func (c ConsolePrinter) PrintReport(i int, correction *models.Correction)
PrintReport is called to print/format each non-mutating correction (diff2.REPORT).
func (ConsolePrinter) Printf ¶
func (c ConsolePrinter) Printf(format string, args ...interface{})
Printf is called to print/format information.
func (ConsolePrinter) Println ¶
func (c ConsolePrinter) Println(lines ...string)
Println is called to print/format information.
func (ConsolePrinter) PromptToRun ¶
func (c ConsolePrinter) PromptToRun() bool
PromptToRun prompts the user to see if they want to execute a correction.
func (ConsolePrinter) StartDNSProvider ¶
func (c ConsolePrinter) StartDNSProvider(provider string, skip bool)
StartDNSProvider is called at the start of each new provider.
func (ConsolePrinter) StartDomain ¶
func (c ConsolePrinter) StartDomain(domain string)
StartDomain is called at the start of each domain.
func (ConsolePrinter) StartRegistrar ¶
func (c ConsolePrinter) StartRegistrar(provider string, skip bool)
StartRegistrar is called at the start of each new registrar.
func (ConsolePrinter) Warnf ¶
func (c ConsolePrinter) Warnf(format string, args ...interface{})
Warnf is called to print/format a warning.
type Printer ¶
type Printer interface { Debugf(fmt string, args ...interface{}) Printf(fmt string, args ...interface{}) Println(lines ...string) Warnf(fmt string, args ...interface{}) Errorf(fmt string, args ...interface{}) }
Printer is a simple abstraction for printing data. Can be passed to providers to give simple output capabilities.