Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintSummary ¶
func PrintSummary(summary api.TemplateSummaryResources, out io.Writer, useColor bool, useBorders bool) error
PrintSummary renders high-level info about a template as a table for display on the console.
NOTE: The implementation here is very "static" in that it's hard-coded to look for specific resource-kinds and fields within those kinds. If the API changes to add more kinds / more fields, this function won't automatically pick them up & print them. It'd be nice to rework this to be less opinionated / more resilient to extension in the future...
func ReadSources ¶
Types ¶
type DiffPrinter ¶
type DiffPrinter struct {
// contains filtered or unexported fields
}
func NewDiffPrinter ¶
func NewDiffPrinter(w io.Writer, hasColor, hasBorder bool) *DiffPrinter
func (*DiffPrinter) Append ¶
func (d *DiffPrinter) Append(slc []string)
func (*DiffPrinter) AppendDiff ¶
func (d *DiffPrinter) AppendDiff(remove, add []string, assumeDiff bool)
AppendDiff appends a diff to the diff printer
assumeDiff says to mark remove/add as a diff (with two lines), even if they are the same. this is used for types that the CLI does not know how to fully compare.
func (*DiffPrinter) Render ¶
func (d *DiffPrinter) Render()
func (*DiffPrinter) SetHeaders ¶
func (d *DiffPrinter) SetHeaders(headers ...string) *DiffPrinter
func (*DiffPrinter) Title ¶
func (d *DiffPrinter) Title(title string) *DiffPrinter
type OutParams ¶
type OutParams struct { Out io.Writer Encoding OutEncoding }
func ParseOutParams ¶
func (OutParams) WriteTemplate ¶
func (o OutParams) WriteTemplate(template []api.TemplateEntry) error
type Source ¶
type Source struct { Name string Encoding Encoding Open func(context.Context) (io.ReadCloser, error) }
func SourcesFromPath ¶
type TablePrinter ¶
type TablePrinter struct {
// contains filtered or unexported fields
}
func NewTablePrinter ¶
func NewTablePrinter(w io.Writer, hasColor, hasBorder bool) *TablePrinter
func (*TablePrinter) Append ¶
func (t *TablePrinter) Append(slc []string)
func (*TablePrinter) Render ¶
func (t *TablePrinter) Render()
func (*TablePrinter) SetHeaders ¶
func (t *TablePrinter) SetHeaders(headers ...string) *TablePrinter
func (*TablePrinter) Title ¶
func (t *TablePrinter) Title(title string) *TablePrinter