printer

package
v0.0.0-...-6fc4f83 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientObjects

func ClientObjects[K NodeResource](nodes []K) []client.Object

func Describe

func Describe(w io.Writer, pairs []*DescriberKV)

Describe writes the key-value paris to the writer. It handles things like properly writing special data types like Tables.

func Print

func Print(p Printer, resourceModel *resourcediscovery.ResourceModel, format utils.OutputFormat)

func SortByString

func SortByString[K NodeResource](items []K) []K

Types

type BackendsPrinter

type BackendsPrinter struct {
	io.Writer
	Clock clock.Clock
}

func (*BackendsPrinter) Print

func (bp *BackendsPrinter) Print(resourceModel *resourcediscovery.ResourceModel)

func (*BackendsPrinter) PrintDescribeView

func (bp *BackendsPrinter) PrintDescribeView(resourceModel *resourcediscovery.ResourceModel)

type DescriberKV

type DescriberKV struct {
	Key   string
	Value any
}

DescriberKV stores key-value pairs that are used with Describing a resource.

type GatewayClassesPrinter

type GatewayClassesPrinter struct {
	io.Writer
	Clock clock.Clock
}

func (*GatewayClassesPrinter) GetPrintableNodes

func (gcp *GatewayClassesPrinter) GetPrintableNodes(resourceModel *resourcediscovery.ResourceModel) []NodeResource

func (*GatewayClassesPrinter) PrintDescribeView

func (gcp *GatewayClassesPrinter) PrintDescribeView(resourceModel *resourcediscovery.ResourceModel)

func (*GatewayClassesPrinter) PrintTable

func (gcp *GatewayClassesPrinter) PrintTable(resourceModel *resourcediscovery.ResourceModel)

type GatewaysPrinter

type GatewaysPrinter struct {
	io.Writer
	Clock clock.Clock
}

func (*GatewaysPrinter) GetPrintableNodes

func (gp *GatewaysPrinter) GetPrintableNodes(resourceModel *resourcediscovery.ResourceModel) []NodeResource

func (*GatewaysPrinter) PrintDescribeView

func (gp *GatewaysPrinter) PrintDescribeView(resourceModel *resourcediscovery.ResourceModel)

func (*GatewaysPrinter) PrintTable

func (gp *GatewaysPrinter) PrintTable(resourceModel *resourcediscovery.ResourceModel)

type HTTPRoutesPrinter

type HTTPRoutesPrinter struct {
	io.Writer
	Clock clock.Clock
}

func (*HTTPRoutesPrinter) GetPrintableNodes

func (hp *HTTPRoutesPrinter) GetPrintableNodes(resourceModel *resourcediscovery.ResourceModel) []NodeResource

func (*HTTPRoutesPrinter) PrintDescribeView

func (hp *HTTPRoutesPrinter) PrintDescribeView(resourceModel *resourcediscovery.ResourceModel)

func (*HTTPRoutesPrinter) PrintTable

func (hp *HTTPRoutesPrinter) PrintTable(resourceModel *resourcediscovery.ResourceModel)

type NamespacesPrinter

type NamespacesPrinter struct {
	io.Writer
	Clock clock.Clock
}

func (*NamespacesPrinter) GetPrintableNodes

func (nsp *NamespacesPrinter) GetPrintableNodes(resourceModel *resourcediscovery.ResourceModel) []NodeResource

func (*NamespacesPrinter) PrintDescribeView

func (nsp *NamespacesPrinter) PrintDescribeView(resourceModel *resourcediscovery.ResourceModel)

func (*NamespacesPrinter) PrintTable

func (nsp *NamespacesPrinter) PrintTable(resourceModel *resourcediscovery.ResourceModel)

type NodeResource

type NodeResource interface {
	ClientObject() client.Object
}

func NodeResources

func NodeResources[K NodeResource](items []K) []NodeResource

type PoliciesPrinter

type PoliciesPrinter struct {
	io.Writer
	Clock clock.Clock
}

func (*PoliciesPrinter) PrintCRDs

func (pp *PoliciesPrinter) PrintCRDs(policyCRDs []policymanager.PolicyCRD, format utils.OutputFormat)

func (*PoliciesPrinter) PrintPolicies

func (pp *PoliciesPrinter) PrintPolicies(policies []policymanager.Policy, format utils.OutputFormat)

func (*PoliciesPrinter) PrintPoliciesDescribeView

func (pp *PoliciesPrinter) PrintPoliciesDescribeView(policies []policymanager.Policy)

func (*PoliciesPrinter) PrintPolicyCRDsDescribeView

func (pp *PoliciesPrinter) PrintPolicyCRDsDescribeView(policyCrds []policymanager.PolicyCRD)

type Printer

type Printer interface {
	io.Writer
	GetPrintableNodes(resourceModel *resourcediscovery.ResourceModel) []NodeResource
	PrintTable(resourceModel *resourcediscovery.ResourceModel)
}

type Table

type Table struct {
	ColumnNames []string
	Rows        [][]string
	// UseSeparator indicates whether the header row and data rows will be
	// separated through a separator.
	UseSeparator bool
}

Jump to

Keyboard shortcuts

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