Documentation
¶
Index ¶
- Variables
- func PrintByteSlice(contents []byte, outputFile string, targetBucket S3Output) error
- type FromToColumns
- type OutputArray
- func (output *OutputArray) AddContents(contents map[string]interface{})
- func (output OutputArray) AddHeader(header string)
- func (output *OutputArray) AddHolder(holder OutputHolder)
- func (output OutputArray) AddToBuffer()
- func (output *OutputArray) ContentsAsInterfaces() [][]interface{}
- func (output OutputArray) GetContentsMap() []map[string]string
- func (output OutputArray) GetContentsMapRaw() []map[string]interface{}
- func (output OutputArray) HtmlTableOnly() []byte
- func (output *OutputArray) KeysAsInterface() []interface{}
- func (output OutputArray) Write()
- type OutputHolder
- type OutputSettings
- func (settings *OutputSettings) AddFromToColumns(from string, to string)
- func (settings *OutputSettings) AddFromToColumnsWithLabel(from string, to string, label string)
- func (settings *OutputSettings) GetDefaultExtension() string
- func (settings *OutputSettings) GetSeparator() string
- func (settings *OutputSettings) NeedsFromToColumns() bool
- func (settings *OutputSettings) SetOutputFormat(format string)
- func (settings *OutputSettings) SetS3Bucket(client *s3.Client, bucket string, path string)
- func (settings *OutputSettings) StringBold(text string) string
- func (settings *OutputSettings) StringBoldInline(text string) string
- func (settings *OutputSettings) StringFailure(text interface{}) string
- func (settings *OutputSettings) StringInfo(text interface{}) string
- func (settings *OutputSettings) StringPositive(text string) string
- func (settings *OutputSettings) StringPositiveInline(text string) string
- func (settings *OutputSettings) StringSuccess(text interface{}) string
- func (settings *OutputSettings) StringWarning(text string) string
- func (settings *OutputSettings) StringWarningInline(text string) string
- type S3Output
Constants ¶
This section is empty.
Variables ¶
var TableStyles = map[string]table.Style{ "Default": table.StyleDefault, "Bold": table.StyleBold, "ColoredBright": table.StyleColoredBright, "ColoredDark": table.StyleColoredDark, "ColoredBlackOnBlueWhite": table.StyleColoredBlackOnBlueWhite, "ColoredBlackOnCyanWhite": table.StyleColoredBlackOnCyanWhite, "ColoredBlackOnGreenWhite": table.StyleColoredBlackOnGreenWhite, "ColoredBlackOnMagentaWhite": table.StyleColoredBlackOnMagentaWhite, "ColoredBlackOnYellowWhite": table.StyleColoredBlackOnYellowWhite, "ColoredBlackOnRedWhite": table.StyleColoredBlackOnRedWhite, "ColoredBlueWhiteOnBlack": table.StyleColoredBlueWhiteOnBlack, "ColoredCyanWhiteOnBlack": table.StyleColoredCyanWhiteOnBlack, "ColoredGreenWhiteOnBlack": table.StyleColoredGreenWhiteOnBlack, "ColoredMagentaWhiteOnBlack": table.StyleColoredMagentaWhiteOnBlack, "ColoredRedWhiteOnBlack": table.StyleColoredRedWhiteOnBlack, "ColoredYellowWhiteOnBlack": table.StyleColoredYellowWhiteOnBlack, }
TableStyles is a lookup map for getting the table styles based on a string
Functions ¶
Types ¶
type FromToColumns ¶
FromToColumns is used to set the From and To columns for graphical output formats
type OutputArray ¶
type OutputArray struct { Settings *OutputSettings Contents []OutputHolder Keys []string }
OutputArray holds all the different OutputHolders that will be provided as output, as well as the keys (headers) that will actually need to be printed
func (*OutputArray) AddContents ¶
func (output *OutputArray) AddContents(contents map[string]interface{})
AddContents adds the provided map[string]interface{} to the OutputHolder and that in turn to the OutputArray
func (OutputArray) AddHeader ¶
func (output OutputArray) AddHeader(header string)
func (*OutputArray) AddHolder ¶
func (output *OutputArray) AddHolder(holder OutputHolder)
AddHolder adds the provided OutputHolder to the OutputArray
func (OutputArray) AddToBuffer ¶
func (output OutputArray) AddToBuffer()
func (*OutputArray) ContentsAsInterfaces ¶
func (output *OutputArray) ContentsAsInterfaces() [][]interface{}
func (OutputArray) GetContentsMap ¶
func (output OutputArray) GetContentsMap() []map[string]string
GetContentsMap returns a stringmap of the output contents
func (OutputArray) GetContentsMapRaw ¶
func (output OutputArray) GetContentsMapRaw() []map[string]interface{}
GetContentsMapRaw returns a interface map of the output contents
func (OutputArray) HtmlTableOnly ¶
func (output OutputArray) HtmlTableOnly() []byte
HtmlTableOnly returns a byte array containing an HTML table of the OutputArray
func (*OutputArray) KeysAsInterface ¶
func (output *OutputArray) KeysAsInterface() []interface{}
func (OutputArray) Write ¶
func (output OutputArray) Write()
Write will provide the output as configured in the configuration
type OutputHolder ¶
type OutputHolder struct {
Contents map[string]interface{}
}
OutputHolder holds key-value pairs that belong together in the output
type OutputSettings ¶
type OutputSettings struct { // Defines whether a table of contents should be added HasTOC bool // The header information for a draw.io/diagrams.net CSV import DrawIOHeader drawio.Header // FrontMatter can be provided for a Markdown output FrontMatter map[string]string // The columns for graphical interfaces to show how parent-child relationships connect FromToColumns *FromToColumns // The type of Mermaid diagram MermaidSettings *mermaid.Settings // The name of the file the output should be saved to OutputFile string // The format of the output file OutputFileFormat string // The format of the output that should be used OutputFormat string // Store the output in the provided S3 bucket S3Bucket S3Output // For table heavy outputs, should there be extra spacing between tables SeparateTables bool // Does the output need to be appended to an existing file? ShouldAppend bool // For columnar outputs (table, html, csv, markdown) split rows with multiple values into separate rows SplitLines bool // The key the output should be sorted by SortKey string // For tables, how wide can a table be? TableMaxColumnWidth int // The style of the table TableStyle table.Style // The title of the output Title string // Should colors be shown in the output UseColors bool // Should emoji be shown in the output UseEmoji bool }
func NewOutputSettings ¶
func NewOutputSettings() *OutputSettings
NewOutputSettings creates and returns a new OutputSettings object with some default values
func (*OutputSettings) AddFromToColumns ¶
func (settings *OutputSettings) AddFromToColumns(from string, to string)
AddFromToColumns sets from to columns for graphical formats
func (*OutputSettings) AddFromToColumnsWithLabel ¶
func (settings *OutputSettings) AddFromToColumnsWithLabel(from string, to string, label string)
AddFromToColumns sets from to columns for graphical formats
func (*OutputSettings) GetDefaultExtension ¶
func (settings *OutputSettings) GetDefaultExtension() string
func (*OutputSettings) GetSeparator ¶
func (settings *OutputSettings) GetSeparator() string
func (*OutputSettings) NeedsFromToColumns ¶
func (settings *OutputSettings) NeedsFromToColumns() bool
NeedsFromToColumns verifies if a format requires from and to columns to be set
func (*OutputSettings) SetOutputFormat ¶
func (settings *OutputSettings) SetOutputFormat(format string)
SetOutputFormat sets the expected output format
func (*OutputSettings) SetS3Bucket ¶
func (settings *OutputSettings) SetS3Bucket(client *s3.Client, bucket string, path string)
func (*OutputSettings) StringBold ¶
func (settings *OutputSettings) StringBold(text string) string
func (*OutputSettings) StringBoldInline ¶
func (settings *OutputSettings) StringBoldInline(text string) string
func (*OutputSettings) StringFailure ¶
func (settings *OutputSettings) StringFailure(text interface{}) string
func (*OutputSettings) StringInfo ¶
func (settings *OutputSettings) StringInfo(text interface{}) string
func (*OutputSettings) StringPositive ¶
func (settings *OutputSettings) StringPositive(text string) string
func (*OutputSettings) StringPositiveInline ¶
func (settings *OutputSettings) StringPositiveInline(text string) string
func (*OutputSettings) StringSuccess ¶
func (settings *OutputSettings) StringSuccess(text interface{}) string
func (*OutputSettings) StringWarning ¶
func (settings *OutputSettings) StringWarning(text string) string
func (*OutputSettings) StringWarningInline ¶
func (settings *OutputSettings) StringWarningInline(text string) string