Documentation
¶
Index ¶
- func BytesToGB[T ~int | ~int64 | ~float64](bytes T) int
- func BytesToTB[T ~int | ~int64 | ~float64](bytes T) float64
- func Contains(slice []string, val string) bool
- func ConvertBytesToMB(bytes int64) int64
- func ConvertMBToBytes(mb int64) int64
- func DerefString(s *string) string
- func FloatPtr(i float64) *float64
- func GBToTB[T ~int | ~int64 | ~float64](gb T) float64
- func GetEnv(key, defaultValue string) string
- func GetIntEnv(key string, defaultValue uint) (uint, error)
- func IntPtr(i int) *int
- func MBToGB[T ~int | ~int32 | ~float64](mb T) int
- func Must(err error)
- func MustString(fn StringerWithError) string
- func Round(f float64) float64
- func ToStrPtr(s string) *string
- type Duration
- type StringerWithError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToGB ¶ added in v0.3.0
BytesToGB converts a value in bytes to gigabytes (GB). Accepts int, int64, or float64.
func BytesToTB ¶ added in v0.3.0
BytesToTB converts a value in bytes to terabytes (TB). Accepts int, int64, or float64.
func ConvertBytesToMB ¶
ConvertBytesToMB converts bytes to megabytes safely
func ConvertMBToBytes ¶
ConvertMBToBytes converts megabytes to bytes safely
func DerefString ¶
DerefString safely dereferences a string pointer, returning an empty string if the pointer is nil
func GBToTB ¶ added in v0.3.0
GBToTB converts a value in gigabytes (GB) to terabytes (TB). Accepts int, int64, or float64.
func MustString ¶
func MustString(fn StringerWithError) string
Types ¶
type Duration ¶
func (*Duration) UnmarshalJSON ¶
type StringerWithError ¶
Click to show internal directories.
Click to hide internal directories.