table

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FuncMap = map[string]any{
		"ago":          FormatCreated,
		"until":        FormatUntil,
		"json":         FormatJSON,
		"jsoncompact":  FormatJSONCompact,
		"yaml":         FormatYAML,
		"boolToStar":   BoolToStar,
		"array":        ToArray,
		"arrayFirst":   ToArrayFirst,
		"arrayNoSpace": ToArrayNoSpace,
		"graph":        Graph,
		"pointer":      Pointer,
		"fullID":       FormatID,
		"alias":        Noop,
		"ownerName":    OwnerReferenceName,
	}
)

Functions

func BoolToStar

func BoolToStar(obj any) (string, error)

func FormatCreated

func FormatCreated(obj any) string

func FormatID

func FormatID(obj kclient.Object) (string, error)

func FormatJSON

func FormatJSON(data any) (string, error)

func FormatJSONCompact

func FormatJSONCompact(data any) (string, error)

func FormatUntil

func FormatUntil(data metav1.Time) string

func FormatYAML

func FormatYAML(data any) (string, error)

func Graph

func Graph(value int) (string, error)

func Noop

func Noop(any) string

func OwnerReferenceName

func OwnerReferenceName(obj metav1.Object) string

func Pointer

func Pointer(data any) string

func SimpleFormat

func SimpleFormat(values [][]string) (string, string)

func ToArray

func ToArray(s []string) (string, error)

func ToArrayFirst

func ToArrayFirst(s []string) (string, error)

func ToArrayNoSpace

func ToArrayNoSpace(s []string) (string, error)

Types

type FormatFunc

type FormatFunc any

type Writer

type Writer interface {
	Write(obj kclient.Object)
	// WriteFormatted will write a newly formatted object that follows the default
	// pattern passed to the NewWriter function.  If the format has been overwritten
	// by the use the formatted object will not be passed to the custom format, but
	// instead the kclient.Object if not nil.  This gives consistency in that users custom
	// formatting always applies to the source kclient.Object, not the intermediate formatted
	// object that was created.
	//
	// sourceObj may be nil
	WriteFormatted(formattedObj any, sourceObj kclient.Object)
	Close() error
	Err() error
	Flush() error
	AddFormatFunc(name string, f FormatFunc)
}

func NewWriter

func NewWriter(values [][]string, quiet bool, format string) Writer

Jump to

Keyboard shortcuts

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