{"modulePath":"github.com/nerdalize/nerd","version":"v0.5.9","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package format\n\n## Constants\n\n```go\nconst (\n\t//OutputTypePretty is used for pretty printing\n\tOutputTypePretty = \"pretty\"\n\t//OutputTypeRaw is used for raw output (nice for unix piping)\n\tOutputTypeRaw = \"raw\"\n\t//OutputTypeJSON is used for JSON output\n\tOutputTypeJSON = \"json\"\n)\n```\n\n## Functions\n\n```go\nfunc NotImplDecorator(ot OutputType) *notImplDecorator\n```\nNotImplDecorator can be used when a decorator is not implemented\n\n## Types\n\n```go\ntype DecMap map[OutputType]Decorator\n```\nDecMap maps an OutputType to a Decorator\n\n```go\ntype Decorator interface {\n\tDecorate(out io.Writer) error\n}\n```\nDecorator decorates a value and writes to out\n\n```go\ntype JSONDecorator struct {\n\t// contains filtered or unexported fields\n}\n```\nJSONDecorator decorates by parsing JSON\n\n```go\nfunc NewJSONDecorator(v interface{}) *JSONDecorator\n```\nNewJSONDecorator is a decorator that outputs JSON\n\n```go\nfunc (d *JSONDecorator) Decorate(out io.Writer) error\n```\nDecorate writes JSON to out\n\n```go\ntype OutputType string\n```\nOutputType is one of prett, raw, or json\n\n```go\ntype Outputter struct {\n\tLogger *log.Logger\n\t// contains filtered or unexported fields\n}\n```\nOutputter is responsible for all output\n\n```go\nfunc NewOutputter(outw, errw io.Writer, logger *log.Logger) *Outputter\n```\nNewOutputter creates a new Outputter that writes to Stdout and Stderr\n\n```go\nfunc (o *Outputter) Close() error\n```\nClose closes the log file\n\n```go\nfunc (o *Outputter) ErrW() io.Writer\n```\nErrW returns the err writer\n\n```go\nfunc (o *Outputter) Output(d DecMap)\n```\nOutput outputs using the right decorator\n\n```go\nfunc (o *Outputter) SetDebug(debug bool)\n```\nSetDebug sets debug outputting\n\n```go\nfunc (o *Outputter) SetLogToDisk(location string) error\n```\nSetLogToDisk sets a logfile to write to\n\n```go\nfunc (o *Outputter) SetOutputType(ot OutputType)\n```\nSetOutputType sets the output type\n\n```go\nfunc (o *Outputter) WriteError(err error)\n```\nWriteError writes an error to errw\n\n```go\ntype TableDecorator struct {\n\t// contains filtered or unexported fields\n}\n```\nTableDecorator will attempt to structure a table\n\n```go\nfunc NewTableDecorator(v interface{}, header, tmpl string) *TableDecorator\n```\nNewTableDecorator is a decorator that writes a table using golang's templating\n\n```go\nfunc (d *TableDecorator) Decorate(out io.Writer) error\n```\nDecorate writes the table to out\n\n```go\ntype TmplDecorator struct {\n\t// contains filtered or unexported fields\n}\n```\nTmplDecorator decorates by simply executing a template\n\n```go\nfunc NewTmplDecorator(v interface{}, tmpl string) *TmplDecorator\n```\nNewTmplDecorator is a decorator that uses golang's templating\n\n```go\nfunc (d *TmplDecorator) Decorate(out io.Writer) error\n```\nDecorate writes templated output to out\n\n","path":"github.com/nerdalize/nerd/command/format","name":"format","synopsis":"","isRedistributable":true}
