Documentation
¶
Index ¶
- func BytesToGigabytes(b uint64) float64
- func BytesToMegabytes(b float64) float64
- func FileExists(path string) bool
- func GetEnv(key string) (value string, exists bool)
- func LookPathHomebrew(file string) (string, error)
- func ReadStringFile(path string) string
- func ReadStringFileLimited(path string, maxSize int) (string, error)
- func ReadStringFileOK(path string) (string, bool)
- func ReadUintFile(path string) (uint64, bool)
- func TwoDecimals(value float64) float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToGigabytes ¶
BytesToGigabytes converts bytes to gigabytes and rounds to two decimal places.
func BytesToMegabytes ¶
BytesToMegabytes converts bytes to megabytes and rounds to two decimal places.
func FileExists ¶
FileExists reports whether the given path exists.
func GetEnv ¶
GetEnv retrieves an environment variable with a "BESZEL_AGENT_" prefix, or falls back to the unprefixed key.
func LookPathHomebrew ¶
LookPathHomebrew is like exec.LookPath but also checks Homebrew paths.
func ReadStringFile ¶
ReadStringFile returns trimmed file contents or empty string on error.
func ReadStringFileLimited ¶
ReadStringFileLimited reads a file into a string with a maximum size (in bytes) to avoid allocating large buffers and potential panics with pseudo-files when the size is misreported.
func ReadStringFileOK ¶
ReadStringFileOK returns trimmed file contents and read success.
func ReadUintFile ¶
ReadUintFile parses a decimal uint64 value from a file.
func TwoDecimals ¶
TwoDecimals rounds a float64 value to two decimal places.
Types ¶
This section is empty.