tableconverters

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RootVolumeName      = "downward-api.volumepoollet.ironcore.dev/root-volume-name"
	RootVolumeNamespace = "downward-api.volumepoollet.ironcore.dev/root-volume-namespace"
)

Variables

View Source
var (
	Events = tableconverter.Funcs[*iri.Event]{
		Headers: tableconverter.Headers(eventHeaders),
		Rows: tableconverter.SingleRowFrom(func(event *iri.Event) (api.Row, error) {
			return api.Row{
				event.Spec.GetInvolvedObjectMeta().Id,
				event.Spec.Type,
				event.Spec.Reason,
				event.Spec.Message,
				getRootVolumeName(event.Spec.GetInvolvedObjectMeta().Labels),
				getRootVolumeNamespace(event.Spec.GetInvolvedObjectMeta().Labels),
			}, nil
		}),
	}

	EventsSlice = tableconverter.SliceFuncs[*iri.Event](Events)
)
View Source
var (
	RegistryBuilder tableconverter.RegistryBuilder
	AddToRegistry   = RegistryBuilder.AddToRegistry
)
View Source
var (
	VolumeClassStatus = tableconverter.Funcs[*iri.VolumeClassStatus]{
		Headers: tableconverter.Headers(volumeClassHeaders),
		Rows: tableconverter.SingleRowFrom(func(status *iri.VolumeClassStatus) (api.Row, error) {
			return api.Row{
				status.VolumeClass.Name,
				resource.NewQuantity(status.VolumeClass.Capabilities.Tps, resource.BinarySI).String(),
				resource.NewQuantity(status.VolumeClass.Capabilities.Iops, resource.DecimalSI).String(),
				resource.NewQuantity(status.Quantity, resource.BinarySI).String(),
			}, nil
		}),
	}
	VolumeClassStatusSlice = tableconverter.SliceFuncs[*iri.VolumeClassStatus](VolumeClassStatus)
)
View Source
var (
	Volume = tableconverter.Funcs[*iri.Volume]{
		Headers: tableconverter.Headers(volumeHeaders),
		Rows: tableconverter.SingleRowFrom(func(volume *iri.Volume) (api.Row, error) {
			return api.Row{
				volume.Metadata.Id,
				volume.Spec.Class,
				volume.Spec.Image,
				volume.Status.State.String(),
				duration.HumanDuration(time.Since(time.Unix(0, volume.Metadata.CreatedAt))),
			}, nil
		}),
	}
	VolumeSlice = tableconverter.SliceFuncs[*iri.Volume](Volume)
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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