tool

package
v0.33.1 Latest Latest
Warning

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

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

Documentation

Overview

Package tool provides convenience helpers useful to the lxkns CLI tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReflectValuesSlice

func ReflectValuesSlice[E any](e []E) []reflect.Value

ReflectValuesSlice returns a slice of reflect.Value objects for the specified slice of elements.

func Sort

func Sort[E any](s []E, less func(e1, e2 E) int) []E

Sort sorts a copy of the passed slice using the specified less function and returns the sorted copy.

func SortRootNamespaces

func SortRootNamespaces(roots reflect.Value) (children []reflect.Value)

SortRootNamespaces sorts the specified slice of model.Namespace objects by their IDs and then returns the sorted list as a slice consisting of reflection values for the individual namespace objects.

func Space added in v0.26.0

func Space(s string, more ...string) string

Space concatenates the passed strings, ensuring they are properly separated by only a single space between each source string, where necessary. Empty strings are correctly handled without inserting unnecessary separating spaces.

Types

This section is empty.

Jump to

Keyboard shortcuts

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