utils

package
v0.9.21 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSpaces

func DeleteSpaces(str string) string

// https://stackoverflow.com/questions/7052693/how-to-get-the-name-of-a-function-in-go

func GetFunctionName(temp interface{}) string {
	strs := strings.Split((runtime.FuncForPC(reflect.ValueOf(temp).Pointer()).Name()), ".")
	return strs[len(strs)-1]
}

https://stackoverflow.com/questions/32081808/strip-all-whitespace-from-a-string

func FuzzySearch

func FuzzySearch(str string, strList []string, threshold float32) (string, error)

func IsRunningInContainer

func IsRunningInContainer() bool

func IsRunningInDocker

func IsRunningInDocker() bool

func IsRunningInK8s

func IsRunningInK8s() bool

func IsStringInFile

func IsStringInFile(s, path string) bool

func IsStringInSlice

func IsStringInSlice(a string, list []string) bool

func NewReadCloser

func NewReadCloser(r io.Reader, closure func() error) io.ReadCloser

func RemoveScheme

func RemoveScheme(s string) string

Types

type NopStringWriteCloser

type NopStringWriteCloser struct {
	strings.Builder
}

func (NopStringWriteCloser) Close

func (NopStringWriteCloser) Close() error

Jump to

Keyboard shortcuts

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