output

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FormatJSON is the --output flag value for json output.
	FormatJSON = "json"

	// FormatTable is the --output flag value for tablular output.
	FormatTable = "table"

	// FormatYAML is the --output flag value for yaml output.
	FormatYAML = "yaml"
)
View Source
const DefaultPageWidth = 80

DefaultPageWidth is the page (screen) width to use when we need to twiddle the width of some table columns for better viewing. For now assume it's only 80, but if we can figure out a nice (quick) way to determine this for all platforms, include Windows, then we should probably use that value instead.

Variables

This section is empty.

Functions

func NewDetailsTable

func NewDetailsTable(w io.Writer) *tablewriter.Table

NewDetailsTable builds a table formatted to list details for a single result.

func WriteAssociatedBindings

func WriteAssociatedBindings(w io.Writer, bindings []v1beta1.ServiceBinding)

WriteAssociatedBindings prints a list of bindings associated with an instance.

func WriteAssociatedInstances

func WriteAssociatedInstances(w io.Writer, instances []v1beta1.ServiceInstance)

WriteAssociatedInstances prints a list of instances associated with a plan.

func WriteAssociatedPlans

func WriteAssociatedPlans(w io.Writer, plans []servicecatalog.Plan)

WriteAssociatedPlans prints a list of plans associated with a class.

func WriteAssociatedSecret

func WriteAssociatedSecret(w io.Writer, secret *v1.Secret, err error, showSecrets bool)

WriteAssociatedSecret prints the secret data associated with a binding.

func WriteBinding

func WriteBinding(w io.Writer, outputFormat string, binding v1beta1.ServiceBinding)

WriteBinding prints a single bindings in the specified output format.

func WriteBindingDetails

func WriteBindingDetails(w io.Writer, binding *v1beta1.ServiceBinding)

WriteBindingDetails prints details for a single binding.

func WriteBindingList

func WriteBindingList(w io.Writer, outputFormat string, bindingList *v1beta1.ServiceBindingList)

WriteBindingList prints a list of bindings in the specified output format.

func WriteBroker

func WriteBroker(w io.Writer, outputFormat string, broker servicecatalog.Broker)

WriteBroker prints a broker in the specified output format.

func WriteBrokerDetails

func WriteBrokerDetails(w io.Writer, broker servicecatalog.Broker)

WriteBrokerDetails prints details for a single broker.

func WriteBrokerList

func WriteBrokerList(w io.Writer, outputFormat string, brokers ...servicecatalog.Broker)

WriteBrokerList prints a list of brokers in the specified output format.

func WriteClass

func WriteClass(w io.Writer, outputFormat string, class servicecatalog.Class)

WriteClass prints a single class in the specified output format.

func WriteClassAndPlanDetails added in v0.1.36

func WriteClassAndPlanDetails(w io.Writer, classes []servicecatalog.Class, plans [][]servicecatalog.Plan)

WriteClassAndPlanDetails prints details for multiple classes and plans

func WriteClassDetails

func WriteClassDetails(w io.Writer, class servicecatalog.Class)

WriteClassDetails prints details for a single class.

func WriteClassList

func WriteClassList(w io.Writer, outputFormat string, classes ...servicecatalog.Class)

WriteClassList prints a list of classes in the specified output format.

func WriteClientVersion

func WriteClientVersion(w io.Writer, client string)

WriteClientVersion prints client version

func WriteDefaultProvisionParameters added in v0.1.37

func WriteDefaultProvisionParameters(w io.Writer, plan servicecatalog.Plan)

WriteDefaultProvisionParameters prints the default provision parameters for a single plan.

func WriteDeletedBindingNames

func WriteDeletedBindingNames(w io.Writer, bindings []v1beta1.ServiceBinding)

WriteDeletedBindingNames prints the names of a list of bindings

func WriteDeletedResourceName

func WriteDeletedResourceName(w io.Writer, resourceName string)

WriteDeletedResourceName prints the name of a deleted resource

func WriteInstance

func WriteInstance(w io.Writer, outputFormat string, instance v1beta1.ServiceInstance)

WriteInstance prints a single instance

func WriteInstanceDetails

func WriteInstanceDetails(w io.Writer, instance *v1beta1.ServiceInstance)

WriteInstanceDetails prints an instance.

func WriteInstanceList

func WriteInstanceList(w io.Writer, outputFormat string, instanceList *v1beta1.ServiceInstanceList)

WriteInstanceList prints a list of instances.

func WriteParentInstance

func WriteParentInstance(w io.Writer, instance *v1beta1.ServiceInstance)

WriteParentInstance prints identifying information for a parent instance.

func WriteParentPlan

func WriteParentPlan(w io.Writer, plan *v1beta1.ClusterServicePlan)

WriteParentPlan prints identifying information for a parent class.

func WritePlan

func WritePlan(w io.Writer, outputFormat string, plan servicecatalog.Plan, class servicecatalog.Class)

WritePlan prints a single plan in the specified output format.

func WritePlanDetails

func WritePlanDetails(w io.Writer, plan servicecatalog.Plan, class servicecatalog.Class)

WritePlanDetails prints details for a single plan.

func WritePlanList

func WritePlanList(w io.Writer, outputFormat string, plans []servicecatalog.Plan, classes []servicecatalog.Class)

WritePlanList prints a list of plans in the specified output format.

func WritePlanSchemas

func WritePlanSchemas(w io.Writer, plan servicecatalog.Plan)

WritePlanSchemas prints the schemas for a single plan.

func WriteServerVersion

func WriteServerVersion(w io.Writer, server string)

WriteServerVersion prints server version

Types

type ListTable

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

ListTable is a proxy for 'tablewriter.Table' so we can support a variable width column that tries to fill up extra space on the line when needed. For each func on tablewriter.Table we use we'll need a proxy func. We save the headers and rows and only send them on when Render() is called because the tablewriter stuff won't respect the call to SetColMinWidth if it's called after some rows have been added. So we need to calc the value of our special column first, call SetColMinWidth and then add the headers/rows.

func NewListTable

func NewListTable(w io.Writer) *ListTable

NewListTable builds a table formatted to list a set of results.

func (*ListTable) Append

func (lt *ListTable) Append(row []string)

Append will look at each column in the row to see if it's longer than any previous value, and save it if so. Then it saves the data for later rendering.

func (*ListTable) Render

func (lt *ListTable) Render()

Render will calc the width of the variable column if asked to. Then pass our headers and rows to the real Render func to display it.

func (*ListTable) SetBorder

func (lt *ListTable) SetBorder(b bool)

SetBorder is a proxy/pass-thru to the tablewriter.Table's func

func (*ListTable) SetColMinWidth

func (lt *ListTable) SetColMinWidth(c, w int)

SetColMinWidth is a proxy/pass-thru to the tablewriter.Table's func

func (*ListTable) SetHeader

func (lt *ListTable) SetHeader(keys []string)

SetHeader tracks the width of each header value as we save them.

func (*ListTable) SetPageWidth

func (lt *ListTable) SetPageWidth(w int)

SetPageWidth allows us to change the screen/page width. Probably not used right now, so it's just for future need.

func (*ListTable) SetVariableColumn

func (lt *ListTable) SetVariableColumn(c int)

SetVariableColumn tells us which column, if any, should be of variable width so that the table takes up the width of the screen rather than wrapping cells in this column prematurely.

Jump to

Keyboard shortcuts

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