Documentation ¶
Overview ¶
Package replyfmt formats Replies for presentation to users
Index ¶
- Constants
- func FormatAggregates(w *bufio.Writer, f OutputFormat, action *agent.Action, opts ...Option) error
- func FormatReply(w *bufio.Writer, f OutputFormat, action *agent.Action, sender string, ...) error
- type ConsoleFormatter
- func (c *ConsoleFormatter) FormatAggregates(w *bufio.Writer, action *agent.Action) error
- func (c *ConsoleFormatter) FormatReply(w *bufio.Writer, action *agent.Action, sender string, reply *client.RPCReply) error
- func (c *ConsoleFormatter) SetDisplay(m DisplayMode)
- func (c *ConsoleFormatter) SetSilent()
- func (c *ConsoleFormatter) SetVerbose()
- type DisplayMode
- type Formatter
- type Option
- type OutputFormat
Constants ¶
View Source
const ( DisplayDDL = DisplayMode(iota) DisplayOK DisplayFailed DisplayAll DisplayNone )
View Source
const ( // UnknownFormat is an unknown format UnknownFormat = OutputFormat(iota) // ConsoleFormat is a format suitable for displaying on the console ConsoleFormat )
Variables ¶
This section is empty.
Functions ¶
func FormatAggregates ¶
Types ¶
type ConsoleFormatter ¶
type ConsoleFormatter struct {
// contains filtered or unexported fields
}
func NewConsoleFormatter ¶
func NewConsoleFormatter(opts ...Option) *ConsoleFormatter
func (*ConsoleFormatter) FormatAggregates ¶
func (*ConsoleFormatter) FormatReply ¶
func (*ConsoleFormatter) SetDisplay ¶
func (c *ConsoleFormatter) SetDisplay(m DisplayMode)
func (*ConsoleFormatter) SetSilent ¶
func (c *ConsoleFormatter) SetSilent()
func (*ConsoleFormatter) SetVerbose ¶
func (c *ConsoleFormatter) SetVerbose()
type Formatter ¶
type Formatter interface { FormatReply(w *bufio.Writer, action *agent.Action, sender string, reply *client.RPCReply) error FormatAggregates(w *bufio.Writer, action *agent.Action) error SetVerbose() SetSilent() SetDisplay(mode DisplayMode) }
Formatter formats and writes a reply into the bufio writer
type Option ¶
Option configures a formatter
func ConsoleNoColor ¶
func ConsoleNoColor() Option
ConsoleNoColor disables color in the console formatter
func Display ¶
func Display(d DisplayMode) Option
Click to show internal directories.
Click to hide internal directories.