Documentation
¶
Index ¶
- func FormatTimeToISO8601(t time.Time) string
- func GenerateRandomString(length int) (string, error)
- func GetConfigFilePath(filename string) (string, error)
- func GetConfigPath() (string, error)
- func GetCurrentTimestamp() int64
- func GetCurrentTimestampMillis() int64
- func GetProjectRoot() (string, error)
- func GetProjectRootFromWorkingDir() (string, error)
- func IsEmpty(s string) bool
- func IsTimeInRange(t, start, end time.Time) bool
- func ParseISO8601(s string) (time.Time, error)
- func ToCamelCase(s string) string
- func ToSnakeCase(s string) string
- func Unmarshal[T any](data []byte) (T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatTimeToISO8601 ¶
FormatTimeToISO8601 formats time to ISO 8601 string
func GenerateRandomString ¶
GenerateRandomString generates a random string of specified length
func GetConfigFilePath ¶
GetConfigFilePath returns the path to a specific config file
func GetConfigPath ¶
GetConfigPath returns the path to the configs directory
func GetCurrentTimestamp ¶
func GetCurrentTimestamp() int64
GetCurrentTimestamp returns current timestamp in seconds
func GetCurrentTimestampMillis ¶
func GetCurrentTimestampMillis() int64
GetCurrentTimestampMillis returns current timestamp in milliseconds
func GetProjectRoot ¶
GetProjectRoot returns the absolute path to the project root directory by searching for go.mod file from the current file's directory upwards
func GetProjectRootFromWorkingDir ¶
GetProjectRootFromWorkingDir returns the project root by searching from current working directory This is useful when you want to find root from where the application is running
func IsTimeInRange ¶
IsTimeInRange checks if given time is within the specified range
func ParseISO8601 ¶
ParseISO8601 parses ISO 8601 string to time
Types ¶
This section is empty.