utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyEquals

func AnyEquals[T comparable](list []T, value T) bool

func BeginsWith

func BeginsWith(subject, find string) bool

func GetKeys added in v0.0.2

func GetKeys[T_Key comparable, T_Value interface{}](subject map[T_Key]T_Value) []T_Key

func HasHeaderWithValue

func HasHeaderWithValue(headers *http.Header, headerKeyToSearch, headerValueToSearch string) bool

func IndexOf added in v0.0.2

func IndexOf[T comparable](list []T, value T) int

func JoinMap

func JoinMap[K comparable, V comparable](mapDst map[K]V, mapSrc map[K]V)

func ListsEqual

func ListsEqual[T comparable](listA []T, listB []T) bool

func ListsEqualUnsorted added in v0.0.2

func ListsEqualUnsorted[T comparable](listA, listB []T) bool

func MapContains

func MapContains[K comparable, V comparable](m map[K]V, key K, value V) bool

func MapMapValueOnly added in v0.0.2

func MapMapValueOnly[T_Key comparable, T_Value comparable, T_ValueB interface{}](
	subject map[T_Key]T_Value,
	transform func(value T_Value) T_ValueB,
) map[T_Key]T_ValueB

func MarshalJsonHelper added in v0.0.2

func MarshalJsonHelper[T comparable](
	mapValues map[T]string,
	errorMessage string,
	value *T,
) ([]byte, error)

func MktempDir

func MktempDir() (string, error)

func ReplaceRegex

func ReplaceRegex(subject string, find []string, replaceWith string) string

func UnmarshalJsonHelper added in v0.0.2

func UnmarshalJsonHelper[T comparable](
	value *T,
	mapValues map[T]string,
	data []byte,
	errorMessage string,
) error

func Unquote

func Unquote(subject string) string

func WrapIn added in v0.0.2

func WrapIn(wrapper string) func(subject string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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