Documentation ¶
Index ¶
- func ArrayContainsString(s *[]string, str string) bool
- func FetchEnvVar(envName string) string
- func FetchEnvVarAsInt16(envName string) int16
- func FetchEnvVarAsInt64(envName string) int64
- func FetchEnvVarAsTime(envName string, layout string) time.Time
- func GenerateUUID() uuid.UUID
- func GzipCompressJSON(ctx context.Context, jsonData []byte) ([]byte, error)
- func GzipDecompressIfNeeded(ctx context.Context, data []byte) ([]byte, error)
- func ParseJSON(jsonData []byte) (map[string]interface{}, error)
- func ParseJSONIntoStruct[T json.Unmarshaler](jsonData []byte, target T) (T, error)
- func ParseTimeWithMultipleLayouts(s string, layouts ...string) (time.Time, error)
- func RandomString(n int) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayContainsString ¶
ArrayContainsString - check if an array of string contains a given string.
func FetchEnvVarAsInt16 ¶
FetchEnvVarAsInt16 - fetch env var as int16.
func FetchEnvVarAsInt64 ¶
FetchEnvVarAsInt64 - fetch env var as int64.
func FetchEnvVarAsTime ¶
FetchEnvVarAsTime - fetch evn var as time.
func GzipCompressJSON ¶
GzipCompressJSON compresses a JSON-encoded byte slice using gzip.
func GzipDecompressIfNeeded ¶
GzipDecompressIfNeeded decompresses the data if it's gzipped
func ParseJSONIntoStruct ¶
ParseJSONIntoStruct parses the JSON data into a map target needs to be a pointer to a struct
func ParseTimeWithMultipleLayouts ¶
ParseTimeWithMultipleLayouts parses the time string with the provided layouts or as a numeric timestamp.
func RandomString ¶
RandomString - Generate a random string of a given length.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.