Documentation ¶
Overview ¶
Package afmt (Advanced formatter or Advanced fmt) implement some extensions for fmt package. The main feature is print to tree structure.
Package afmt (Advanced formatter or Advanced fmt) implement some extensions for fmt package. The main feature is print to tree structure.
Package afmt (Advanced formatter or Advanced fmt) implement some extensions for fmt package. The main feature is print to tree structure.
Package afmt (Advanced formatter or Advanced fmt) implement some extensions for fmt package. The main feature is print to tree structure.
Index ¶
- func FprintCol(w io.Writer, lineLimit int, a ...interface{}) (n int, err error)
- func FprintlnCol(w io.Writer, lineLimit int, a ...interface{}) (n int, err error)
- func PrintCol(lineLimit int, a ...interface{}) (n int, err error)
- func PrintTree(structure interface{}) error
- func PrintlnCol(lineLimit int, a ...interface{}) (n int, err error)
- type ColPrinter
- type TreePrinter
- type TreePrinterOption
- type TreePrinterOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FprintCol ¶
FprintCol formats using the default formats for its operands and writes to w. Spaces are added between operands when neither is a string. Newline is always added in order to respect column maximum characters. It returns the number of bytes written and any write error encountered.
func FprintlnCol ¶
FprintlnCol formats using the default formats for its operands and writes to w. Spaces are always added between operands and a newline is appended. Newline is always added in order to respect column maximum characters. It returns the number of bytes written and any write error encountered.
func PrintCol ¶
PrintCol formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. Newline is always added in order to respect column maximum characters. It returns the number of bytes written and any write error encountered.
func PrintTree ¶
func PrintTree(structure interface{}) error
PrintTree print input to standard output structured to tree representation.
func PrintlnCol ¶
PrintlnCol formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. Newline is always added in order to respect column maximum characters. It returns the number of bytes written and any write error encountered.
Types ¶
type ColPrinter ¶
type ColPrinter struct{}
ColPrinter definition.
func NewColPrinter ¶
func NewColPrinter() *ColPrinter
NewColPrinter allocates new column printer object.
func (*ColPrinter) Print ¶
func (c *ColPrinter) Print(lineLimit int, a ...interface{}) (out string)
Print adding spaces between operands when neither is a string. Newline is always added in order to respect column maximum characters (lineLimit). It return string with maximum length of line based on lineLimit.
type TreePrinter ¶
type TreePrinter struct {
// contains filtered or unexported fields
}
TreePrinter definition.
func NewTreePrinter ¶
func NewTreePrinter(opts ...TreePrinterOption) *TreePrinter
NewTreePrinter create new TreePrinter `instance`.
func (*TreePrinter) Print ¶
func (p *TreePrinter) Print(inspect interface{}) (string, error)
Print method represents entry point for
type TreePrinterOption ¶
type TreePrinterOption func(*TreePrinterOptions)
TreePrinterOption specification for Printer package.
func TreePrinterOptionIgnoreNames ¶
func TreePrinterOptionIgnoreNames(names []string) TreePrinterOption
TreePrinterOptionIgnoreNames option specification.
func TreePrinterOptionIgnoreUnsupported ¶
func TreePrinterOptionIgnoreUnsupported(ignoreUnsupported bool) TreePrinterOption
TreePrinterOptionIgnoreUnsupported option specification.
func TreePrinterOptionPadding ¶
func TreePrinterOptionPadding(padding uint) TreePrinterOption
TreePrinterOptionPadding option specification.
func TreePrinterOptionPrettyNames ¶
func TreePrinterOptionPrettyNames(names map[string]string) TreePrinterOption
TreePrinterOptionPrettyNames option specification.
type TreePrinterOptions ¶
type TreePrinterOptions struct { // Ignore unsupported types, otherwise return error IgnoreUnsupported bool // Padding by spaces Padding uint // Pretty name for printer PrettyNames map[string]string // Ignore specified parts of structure (do not print these ones) IgnoreNames []string }
TreePrinterOptions are used for Server construct function.