table

package
v0.10.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FuncMap = map[string]any{
		"ago":           FormatCreated,
		"until":         FormatUntil,
		"lastRun":       FormatLastRun,
		"nextRun":       FormatNextRun,
		"json":          FormatJSON,
		"jsoncompact":   FormatJSONCompact,
		"yaml":          FormatYAML,
		"first":         FormatFirst,
		"toJson":        ToJSON,
		"boolToStar":    BoolToStar,
		"array":         ToArray,
		"arrayFirst":    ToArrayFirst,
		"arrayNoSpace":  ToArrayNoSpace,
		"graph":         Graph,
		"pointer":       Pointer,
		"fullID":        FormatID,
		"name":          Name,
		"trunc":         Trunc,
		"alias":         Noop,
		"appGeneration": AppGeneration,
		"displayRange":  DisplayRange,
		"memoryToRange": MemoryToRange,
		"defaultMemory": DefaultMemory,
		"ownerName":     OwnerReferenceName,
		"imageName":     ImageName,
		"imageCommit":   ImageCommit,
	}
)

Functions

func AppGeneration

func AppGeneration(app apiv1.App, msg string) string

func BoolToStar

func BoolToStar(obj any) (string, error)

func DefaultMemory

func DefaultMemory(obj any) (string, error)

func DisplayRange

func DisplayRange(minVal, maxVal any) (string, error)

func FormatCreated

func FormatCreated(data metav1.Time) string

func FormatFirst

func FormatFirst(data, data2 any) (string, error)

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 FormatLastRun

func FormatLastRun(data *metav1.Time) string

func FormatNextRun

func FormatNextRun(data *metav1.Time) string

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 ImageCommit

func ImageCommit(obj metav1.Object) string

func ImageName

func ImageName(obj metav1.Object) string

func MemoryToRange

func MemoryToRange(obj any) (string, error)

func Name

func Name(obj any) (string, error)

func Noop

func Noop(obj 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)

func ToJSON

func ToJSON(data any) (map[string]any, error)

func Trunc

func Trunc(s string) string

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