output

package
v2.0.0-...-eccd1d4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: BSD-2-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatHuman = "human"
	FormatJSON  = "json"
	FormatYAML  = "yaml"
)

Variables

View Source
var SupportedOutputs = []string{FormatHuman, FormatJSON, FormatYAML}

Functions

func FormatSize

func FormatSize(size int64) string

func LatestVersionString

func LatestVersionString(product *models.Product) string

Types

type EncodedOutput

type EncodedOutput struct {
	Marshall Encoder
	// contains filtered or unexported fields
}

func NewJSONOutput

func NewJSONOutput(writer io.Writer) *EncodedOutput

func NewYAMLOutput

func NewYAMLOutput(writer io.Writer) *EncodedOutput

func (*EncodedOutput) Print

func (o *EncodedOutput) Print(object interface{}) error

func (*EncodedOutput) PrintHeader

func (o *EncodedOutput) PrintHeader(message string)

PrintHeader is a no-op for encoded output. This output only prints the data

func (*EncodedOutput) RenderAssets

func (o *EncodedOutput) RenderAssets(assets []*pkg.Asset) error

func (*EncodedOutput) RenderChart

func (o *EncodedOutput) RenderChart(chart *models.ChartVersion) error

func (*EncodedOutput) RenderCharts

func (o *EncodedOutput) RenderCharts(charts []*models.ChartVersion) error

func (*EncodedOutput) RenderContainerImages

func (o *EncodedOutput) RenderContainerImages(images []*models.DockerVersionList) error

func (*EncodedOutput) RenderFile

func (o *EncodedOutput) RenderFile(file *models.ProductDeploymentFile) error

func (*EncodedOutput) RenderFiles

func (o *EncodedOutput) RenderFiles(files []*models.ProductDeploymentFile) error

func (*EncodedOutput) RenderProduct

func (o *EncodedOutput) RenderProduct(product *models.Product, _ *models.Version) error

func (*EncodedOutput) RenderProducts

func (o *EncodedOutput) RenderProducts(products []*models.Product) error

func (*EncodedOutput) RenderVersions

func (o *EncodedOutput) RenderVersions(product *models.Product) error

type Encoder

type Encoder func(v interface{}) ([]byte, error)

type Format

type Format interface {
	PrintHeader(message string)

	RenderProduct(product *models.Product, version *models.Version) error
	RenderProducts(products []*models.Product) error
	RenderVersions(product *models.Product) error
	RenderChart(chart *models.ChartVersion) error
	RenderCharts(charts []*models.ChartVersion) error
	RenderContainerImages(images []*models.DockerVersionList) error
	RenderFile(file *models.ProductDeploymentFile) error
	RenderFiles(files []*models.ProductDeploymentFile) error

	RenderAssets(assets []*pkg.Asset) error
}

type HumanOutput

type HumanOutput struct {
	// contains filtered or unexported fields
}

func NewHumanOutput

func NewHumanOutput(writer io.Writer, marketplaceHost string) *HumanOutput

func (*HumanOutput) NewTable

func (o *HumanOutput) NewTable(headers ...string) *tablewriter.Table

func (*HumanOutput) PrintHeader

func (o *HumanOutput) PrintHeader(message string)

func (*HumanOutput) Printf

func (o *HumanOutput) Printf(format string, a ...interface{})

func (*HumanOutput) Println

func (o *HumanOutput) Println(a ...interface{})

func (*HumanOutput) RenderAssets

func (o *HumanOutput) RenderAssets(assets []*pkg.Asset) error

func (*HumanOutput) RenderChart

func (o *HumanOutput) RenderChart(chart *models.ChartVersion) error

func (*HumanOutput) RenderCharts

func (o *HumanOutput) RenderCharts(charts []*models.ChartVersion) error

func (*HumanOutput) RenderContainerImages

func (o *HumanOutput) RenderContainerImages(images []*models.DockerVersionList) error

func (*HumanOutput) RenderFile

func (o *HumanOutput) RenderFile(file *models.ProductDeploymentFile) error

func (*HumanOutput) RenderFiles

func (o *HumanOutput) RenderFiles(files []*models.ProductDeploymentFile) error

func (*HumanOutput) RenderProduct

func (o *HumanOutput) RenderProduct(product *models.Product, version *models.Version) error

func (*HumanOutput) RenderProducts

func (o *HumanOutput) RenderProducts(products []*models.Product) error

func (*HumanOutput) RenderVersions

func (o *HumanOutput) RenderVersions(product *models.Product) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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