tool

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 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 Separate

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

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

func Sort

func Sort[E any](s []E, less func(e1, e2 E) bool) []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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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