Documentation ¶
Overview ¶
Package utils for utility functions
Index ¶
- func GetEnv(key, defaultValue string) string
- func MapToProtobufStruct(m map[string]interface{}) (*structpb.Struct, error)
- func ObfuscateValue(input string, char int) string
- func SanitizeErrorMessage(log error, input ...string) error
- func SanitizeLogMessage(log string, input ...string) string
- func SanitizeLogMessageF(log string, input ...string) string
- func SanitizeMessageValue(i interface{}) interface{}
- func SanitizeMongoInput(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapToProtobufStruct ¶
MapToProtobufStruct convert a map to a struct. This helps to encoding the struct to JSON when a message is consumed.
func ObfuscateValue ¶
ObfuscateValue obfuscate the string
func SanitizeErrorMessage ¶
SanitizeErrorMessage removes user input from the err output
func SanitizeLogMessage ¶
SanitizeLogMessage removes user input from the log output
func SanitizeLogMessageF ¶
SanitizeLogMessageF removes user input from the log output and format
func SanitizeMessageValue ¶
func SanitizeMessageValue(i interface{}) interface{}
SanitizeMessageValue ensures that a message's value is an int, int64, bool, string
func SanitizeMongoInput ¶
SanitizeMongoInput sanitize Mongo input to guard against NoSQL injection
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.