Documentation ¶
Overview ¶
Package out provides application output related code
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PrintEnvironment ¶
type PrintEnvironment interface { Writable // PrintFunc represents printing function implementation PrintFunc(w io.Writer, format string, a ...interface{}) // SprintFunc represents printing to string function implementation SprintFunc(format string, a ...interface{}) string // NewPrinter creates new printer NewPrinter() (Printer, error) }
PrintEnvironment represents concrete printing environment abstraction
func NewConsoleEnvironment ¶
func NewConsoleEnvironment() PrintEnvironment
NewConsoleEnvironment creates new PrintEnvironment that outputs to console
func NewWriteFileEnvironment ¶
func NewWriteFileEnvironment(path *string, fs afero.Fs, base PrintEnvironment) PrintEnvironment
NewWriteFileEnvironment creates new file output environment
type Printer ¶
type Printer interface { Writable // Cprint prints data with colorizing support Cprint(format string, a ...interface{}) // Sprintf writes formatted string into another and do cleanup if necessary Sprintf(format string, a ...interface{}) string // Println prints new line Println() }
Printer represents printing abstraction with colorizing support
func NewPrinter ¶
func NewPrinter(pe PrintEnvironment) Printer
NewPrinter creates new Printer interface instance
type StringEnvironment ¶
type StringEnvironment interface { PrintEnvironment fmt.Stringer }
StringEnvironment defines in memory printing environment abstraction
func NewMemoryEnvironment ¶
func NewMemoryEnvironment() StringEnvironment
NewMemoryEnvironment creates new memory PrintEnvironment implementation
type Writable ¶
type Writable interface { // Writer gets underlying io.Writer Writer() io.WriteCloser }
Writable represents io.Writer container
Source Files ¶
Click to show internal directories.
Click to hide internal directories.