utils

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStringIfMissing

func AddStringIfMissing(slice []string, s string) (bool, []string)

AddStringIfMissing adds a string to a slice of strings The provided slice is not changed returns true, slice with appended string if string was not in the list returns false, old list if string was already in the list

func RandomAlphaNumString

func RandomAlphaNumString(length int64) (string, error)

RandomAlphaNumString generates a random string value consisting of [0-9a-z] with a length as configured.

func RemoveString

func RemoveString(slice []string, s string) (bool, []string)

RemoveString removes a string from a slice of strings The provided slice is not changed returns true, slice with removed string if string was contained in the list returns false, old list if string was not in the list

func ShortenMessage

func ShortenMessage(message string, length int) (shortenedMessage string)

ShortenMessage Removes line breaks and shortens the message

func StringSliceContains

func StringSliceContains(slice []string, elem string) bool

StringSliceContains determines whether the given string slice contains a given element.

func Trim

func Trim(input string) (output string)

Trim removes blanks

Types

This section is empty.

Jump to

Keyboard shortcuts

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