utils

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package utils implements some utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterStringFromList

func FilterStringFromList(list []string, strToFilter string) (newList []string)

FilterStringFromList produces a new string slice that does not include the strToFilter argument.

func FirstN

func FirstN(s string, n int) string

FirstN returns the first N runes of the string.

func GenerateName

func GenerateName(name *string, fallback string) string

GenerateName takes a name as string pointer. It returns name if pointer is not nil, otherwise it returns fallback with random suffix.

func GetDefaultLogger

func GetDefaultLogger(logLevel string) logr.Logger

GetDefaultLogger returns a default zapr logger.

func StringInList

func StringInList(list []string, strToSearch string) bool

StringInList returns a boolean indicating whether strToSearch is a member of the string slice passed as the first argument.

Types

This section is empty.

Jump to

Keyboard shortcuts

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