tableconvertor

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 33 Imported by: 8

Documentation

Index

Constants

View Source
const UnknownValue = "<unknown>"
View Source
const (
	ValueNone = "<none>"
)

Variables

This section is empty.

Functions

func ConvertToHumanReadableDateType added in v0.10.0

func ConvertToHumanReadableDateType(timestamp metav1.Time) string

ConvertToHumanReadableDateType returns the elapsed time since timestamp in human-readable approximation. ref: https://github.com/kubernetes/apimachinery/blob/v0.21.1/pkg/api/meta/table/table.go#L63-L70 But works for timestamp before or after now.

func DefaultDetailsColumns added in v0.9.0

func DefaultDetailsColumns() []v1alpha1.ResourceColumnDefinition

func DefaultListColumns added in v0.9.0

func DefaultListColumns() []v1alpha1.ResourceColumnDefinition

func FilterColumnsWithDefaults added in v0.9.0

func TableForList

func TableForList(kc client.Client, items []unstructured.Unstructured) (*v1alpha1.Table, error)

func TableForObject

func TableForObject(kc client.Client, obj runtime.Object) (*v1alpha1.Table, error)

func TxtFuncMap added in v0.5.5

func TxtFuncMap() template.FuncMap

TxtFuncMap returns a 'text/template'.FuncMap

Types

type ObjectNamespace added in v0.8.0

type ObjectNamespace struct {
	Namespace string `json:"namespace,omitempty"`
}

type TableConvertor

type TableConvertor interface {
	ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*v1alpha1.Table, error)
}

func New

func New(fieldPath string, columns []v1alpha1.ResourceColumnDefinition) (TableConvertor, error)

New creates a new table convertor for the provided CRD column definition. If the printer definition cannot be parsed, error will be returned along with a default table convertor.

func NewForList added in v0.9.0

func NewForList(fieldPath string, columns []v1alpha1.ResourceColumnDefinition) (TableConvertor, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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