Documentation ¶
Index ¶
- func GenerateRandomAlphaNumeric(size int) string
- func GetLoggerFromContext(ctx context.Context) any
- func GetMemberFromContext(ctx context.Context) any
- func MapContainsKey(m map[string]string, k string) bool
- func MapContainsValue(m map[string]string, v string) bool
- func SetLoggerToContext(ctx context.Context, logger any) context.Context
- func SetMemberToContext(ctx context.Context, member any) context.Context
- func StringSliceContains(s []string, e string) bool
- func StringSliceContainsOneOf(s []string, e []string) bool
- func StringSliceHasAll(s []string, e []string) bool
- type ContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomAlphaNumeric ¶
GenerateRandomAlphaNumeric generates a random alphanumeric string of the specified size.
Parameters: - size: the length of the generated alphanumeric string Return type: string
func GetLoggerFromContext ¶
func GetMemberFromContext ¶
func MapContainsKey ¶
MapContainsKey checks if the given map contains the specified key.
Parameters: - m: the map to search in - k: the key to search for Return type: bool Returns true if the map contains the key, false otherwise.
func MapContainsValue ¶
MapContainsValue checks if the given map contains the specified value.
Parameters: - m: the map to search in - v: the value to search for Return type: bool Returns true if the map contains the value, false otherwise.
func StringSliceContains ¶
func StringSliceContainsOneOf ¶
StringSliceContainsOneOf checks if any element in slice 'e' is present in slice 's'.
Parameters: - s: the slice to check against - e: the slice containing elements to check Return type: bool
func StringSliceHasAll ¶
StringSliceHasAll checks if all elements in slice 'e' are present in slice 's'.
Parameters: - s: the slice to check against - e: the slice containing elements to check Return type: bool
Types ¶
type ContextKey ¶
type ContextKey string
const ( MEMBER ContextKey = "member" LOGGER ContextKey = "logger" )