output

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERBOSITY_QUIET        uint = 16
	VERBOSITY_NORMAL       uint = 32
	VERBOSITY_VERBOSE      uint = 64
	VERBOSITY_VERY_VERBOSE uint = 128
	VERBOSITY_DEBUG        uint = 256
)
View Source
const (
	OUTPUT_NORMAL uint = 1
	OUTPUT_RAW    uint = 2
	OUTPUT_PLAIN  uint = 4
)

Variables

This section is empty.

Functions

func HasColorSupport

func HasColorSupport() bool

func OpenErrorStream

func OpenErrorStream() *os.File

func OpenOutputStream

func OpenOutputStream() *os.File

Types

type ConsoleOutput

type ConsoleOutput struct {
	StreamOutput
	// contains filtered or unexported fields
}

func NewConsoleOutput

func NewConsoleOutput(verbosity uint, decorated bool, formatter formatter.OutputFormatterInferface) *ConsoleOutput

func (*ConsoleOutput) ErrorOutput

func (o *ConsoleOutput) ErrorOutput() OutputInterface

func (*ConsoleOutput) Section

func (o *ConsoleOutput) Section() *ConsoleSectionOutput

func (*ConsoleOutput) SetDecorated

func (o *ConsoleOutput) SetDecorated(decorated bool)

func (*ConsoleOutput) SetErrorOutput

func (o *ConsoleOutput) SetErrorOutput(output OutputInterface)

func (*ConsoleOutput) SetFormatter

func (o *ConsoleOutput) SetFormatter(formatter formatter.OutputFormatterInferface)

func (*ConsoleOutput) SetVerbosity

func (o *ConsoleOutput) SetVerbosity(verbose uint)

type ConsoleOutputInterface

type ConsoleOutputInterface interface {
	ErrorOutput() OutputInterface
	SetErrorOutput(error OutputInterface)
	Section() ConsoleSectionOutput
}

type ConsoleSectionOutput

type ConsoleSectionOutput struct {
	StreamOutput
	// contains filtered or unexported fields
}

func NewConsoleSectionOutput

func NewConsoleSectionOutput(stream *os.File, sections []*ConsoleSectionOutput, verbosity uint, decorated bool, formatter formatter.OutputFormatterInferface) *ConsoleSectionOutput

func (*ConsoleSectionOutput) AddContent

func (o *ConsoleSectionOutput) AddContent(input string, newLine bool) int

func (*ConsoleSectionOutput) AddNewLineOfInputSubmit added in v0.5.0

func (o *ConsoleSectionOutput) AddNewLineOfInputSubmit()

func (*ConsoleSectionOutput) Clear

func (o *ConsoleSectionOutput) Clear(lines int)

func (*ConsoleSectionOutput) Content

func (o *ConsoleSectionOutput) Content() string

func (*ConsoleSectionOutput) DoWrite

func (o *ConsoleSectionOutput) DoWrite(message string, newLine bool)

func (*ConsoleSectionOutput) Overwrite

func (o *ConsoleSectionOutput) Overwrite(message string)

func (*ConsoleSectionOutput) SetMaxHeight

func (o *ConsoleSectionOutput) SetMaxHeight(height int)

func (*ConsoleSectionOutput) VisibleContent

func (o *ConsoleSectionOutput) VisibleContent() string

type Output

type Output struct {
	// contains filtered or unexported fields
}

func NewOutput

func NewOutput(verbosity uint, decorated bool, f formatter.OutputFormatterInferface) *Output

func (*Output) DoWrite

func (o *Output) DoWrite(message string, newLine bool)

func (*Output) Formatter

func (o *Output) Formatter() formatter.OutputFormatterInferface

func (*Output) IsDebug

func (o *Output) IsDebug() bool

func (*Output) IsDecorated

func (o *Output) IsDecorated() bool

func (*Output) IsQuiet

func (o *Output) IsQuiet() bool

func (*Output) IsVerbose

func (o *Output) IsVerbose() bool

func (*Output) IsVeryVerbose

func (o *Output) IsVeryVerbose() bool

func (*Output) SetDecorated

func (o *Output) SetDecorated(decorated bool)

func (*Output) SetFormatter

func (o *Output) SetFormatter(formatter formatter.OutputFormatterInferface)

func (*Output) SetVerbosity

func (o *Output) SetVerbosity(verbosity uint)

func (*Output) Verbosity

func (o *Output) Verbosity() uint

func (*Output) Write

func (o *Output) Write(message string, newLine bool, options uint)

func (*Output) WriteMany

func (o *Output) WriteMany(messages []string, newLine bool, options uint)

func (*Output) Writeln

func (o *Output) Writeln(s string, options uint)

func (*Output) Writelns

func (o *Output) Writelns(s []string, options uint)

type OutputInterface

type OutputInterface interface {
	SetFormatter(formatter formatter.OutputFormatterInferface)
	Formatter() formatter.OutputFormatterInferface
	SetDecorated(decorated bool)
	IsDecorated() bool
	SetVerbosity(level uint)
	Verbosity() uint
	IsQuiet() bool
	IsVerbose() bool
	IsVeryVerbose() bool
	IsDebug() bool
	Writeln(message string, options uint)
	Writelns(messages []string, options uint)
	Write(message string, newLine bool, options uint)
	WriteMany(messages []string, newLine bool, options uint)
}

type Outputter

type Outputter func(message string, newLine bool)

type StreamOutput

type StreamOutput struct {
	Output
	// contains filtered or unexported fields
}

func NewStreamOutput

func NewStreamOutput(stream *os.File, verbosity uint, decorated bool, formatter formatter.OutputFormatterInferface) *StreamOutput

func (*StreamOutput) Stream

func (o *StreamOutput) Stream() *os.File

type TrimmedBufferOutput

type TrimmedBufferOutput struct {
	Output
	// contains filtered or unexported fields
}

func NewTrimmedBufferOutput

func NewTrimmedBufferOutput(maxLength uint, verbosity uint, decorated bool, formatter formatter.OutputFormatterInferface) *TrimmedBufferOutput

func (*TrimmedBufferOutput) Fetch

func (o *TrimmedBufferOutput) Fetch() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳