Documentation ¶
Overview ¶
Package shared contains common shared information, and utilities.
Index ¶
- func Decode(r io.Reader, v any) error
- func Encode(w io.Writer, v any) error
- func GenerateID(ct string) string
- func GenerateUUID() string
- func Marshal(v any) ([]byte, error)
- func PrintErrorMessages(errors ...error) string
- func ReadAll(r io.Reader) ([]byte, error)
- func RemoveSpacesAndToLower(s string) string
- func SliceContains(source []string, text string) bool
- func TargetName(name, alternative string) (string, error)
- func Unmarshal(data []byte, v any) error
- type N
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateID ¶
GenerateID generates MD5 hash (content-based) based on content. Good to be used to avoid duplicated messages.
func GenerateUUID ¶
func GenerateUUID() string
GenerateUUID generates a RFC4122 UUID and DCE 1.1: Authentication and Security Services.
func PrintErrorMessages ¶
PrintErrorMessages prints the concatenated error messages.
func RemoveSpacesAndToLower ¶
RemoveSpacesAndToLower removes spaces from the string and converts it to
func SliceContains ¶
SliceContains returns true if the slice contains the string.
NOTE: It's case insensitive.
NOTE: @andres moved to here.
func TargetName ¶
TargetName returns the provided target name, or the configured one. A target, depending on the storage, is a collection, a table, a bucket, etc. For ElasticSearch - as it doesn't have a concept of a database - the target is the index.