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: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootBucketName      = "downward-api.bucketpoollet.ironcore.dev/root-bucket-name"
	RootBucketNamespace = "downward-api.bucketpoollet.ironcore.dev/root-bucket-namespace"
)

Variables

View Source
var (
	Bucket = tableconverter.Funcs[*iri.Bucket]{
		Headers: tableconverter.Headers(bucketHeaders),
		Rows: tableconverter.SingleRowFrom(func(bucket *iri.Bucket) (api.Row, error) {
			return api.Row{
				bucket.Metadata.Id,
				bucket.Spec.Class,
				bucket.Status.State.String(),
				duration.HumanDuration(time.Since(time.Unix(0, bucket.Metadata.CreatedAt))),
			}, nil
		}),
	}
	BucketSlice = tableconverter.SliceFuncs[*iri.Bucket](Bucket)
)
View Source
var (
	BucketClass = tableconverter.Funcs[*iri.BucketClass]{
		Headers: tableconverter.Headers(bucketClassHeaders),
		Rows: tableconverter.SingleRowFrom(func(class *iri.BucketClass) (api.Row, error) {
			return api.Row{
				class.Name,
				class.Capabilities.Tps,
				class.Capabilities.Iops,
			}, nil
		}),
	}
	BucketClassSlice = tableconverter.SliceFuncs[*iri.BucketClass](BucketClass)
)
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,
				getRootBucketName(event.Spec.GetInvolvedObjectMeta().Labels),
				getRootBucketNamespace(event.Spec.GetInvolvedObjectMeta().Labels),
			}, nil
		}),
	}

	EventsSlice = tableconverter.SliceFuncs[*iri.Event](Events)
)
View Source
var (
	RegistryBuilder tableconverter.RegistryBuilder
	AddToRegistry   = RegistryBuilder.AddToRegistry
)

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