formatters

package
v1.20.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyGoTemplate

func ApplyGoTemplate(w io.Writer, outputFormat, goTemplate string, data any) error

func BindFormatFlags

func BindFormatFlags(cmd *cobra.Command)

func CompleteOutputFormat

func CompleteOutputFormat(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective)

func ConfigSectionKindName

func ConfigSectionKindName(cs types.ConfigSection) string

func FilterOutEmptyMetadata

func FilterOutEmptyMetadata(metadata types.CoreInstanceMetadata) ([]byte, error)

func FmtDuration

func FmtDuration(d time.Duration) string

func FmtTime

func FmtTime(t time.Time) string

func RenderCreated

func RenderCreated(w io.Writer, created types.Created) error

func RenderCreatedTable

func RenderCreatedTable(w io.Writer, createdID string, createdAt time.Time) error

func RenderDeleted

func RenderDeleted(w io.Writer, deleted types.Deleted) error

func RenderEndpointsTable

func RenderEndpointsTable(w io.Writer, pp []types.PipelinePort, showIDs bool)

func RenderUpdated

func RenderUpdated(w io.Writer, updated types.Updated) error

func RenderUpdatedTable

func RenderUpdatedTable(w io.Writer, updatedAt time.Time) error

func RenderWithTemplating

func RenderWithTemplating(w io.Writer, format OutputFormat, tmpl string, data any) error

func ShouldApplyTemplating

func ShouldApplyTemplating(fmt OutputFormat) (func(w io.Writer, tmpl string, data any) error, bool)

func TemplateFromFlags

func TemplateFromFlags(fs *pflag.FlagSet) string

Types

type OutputFormat

type OutputFormat string
const (
	OutputFormatTable      OutputFormat = "table"
	OutputFormatJSON       OutputFormat = "json"
	OutputFormatYAML       OutputFormat = "yaml"
	OutputFormatGoTmpl     OutputFormat = "go-template"
	OutputFormatGoTmplFile OutputFormat = "go-template-file"
)

func OutputFormatFromFlags

func OutputFormatFromFlags(fs *pflag.FlagSet) OutputFormat

func (OutputFormat) String

func (o OutputFormat) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL