utils

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSpaces added in v0.9.5

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 added in v0.9.6

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

func IsRunningInContainer added in v0.9.9

func IsRunningInContainer() bool

func IsRunningInDocker added in v0.9.9

func IsRunningInDocker() bool

func IsRunningInK8s added in v0.9.9

func IsRunningInK8s() bool

func IsStringInFile added in v0.9.9

func IsStringInFile(s, path string) bool

func IsStringInSlice added in v0.9.9

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

func NewReadCloser added in v0.9.5

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

func RemoveScheme added in v0.9.9

func RemoveScheme(s string) string

Types

type NopStringWriteCloser added in v0.9.6

type NopStringWriteCloser struct {
	strings.Builder
}

func (NopStringWriteCloser) Close added in v0.9.6

func (NopStringWriteCloser) Close() error

Jump to

Keyboard shortcuts

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