Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIf(isErr bool, msg string, args ...any) bool
- func CreateDir(path string) bool
- func CreateFile(path string, content string) bool
- func DefaultIsError(err error, msg string, args ...any) bool
- func Describe(args ...any)
- func FileEmpty(name string) bool
- func FileExists(name string) bool
- func LogTrack(start time.Time, name string) float64
- func Panic(msg string, args ...any)
- func PanicIf(err error, msg string, args ...any)
- func ParentDescribe(args ...any)
- func PercentCPU() float64
- func PercentRAM() float64
- func PipeRunCmd(cmd string, args ...string) error
- func Print(any ...any)
- func PrintParent(any ...any)
- func ReadFile(path string) string
- func ReadFileLines(path string, eachLineFunc func(line string) (exitEarly bool)) (ok bool)
- func RunCmd(cmd string, args ...string) (output []byte)
- func StackTrace(start int) string
- func TimeTrack(start time.Time, name string) float64
- func Trace()
- type CallInfo
Constants ¶
View Source
const WebBR = "\n<br/>"
Variables ¶
View Source
var BgRed, BgGreen (func(format string, a ...any) string)
View Source
var CPU_PERCENT, RAM_PERCENT float64
View Source
var CPU_STAT2, CPU_STAT4, CPU_STAT5, LAST_STAT7 int64
View Source
var DEBUG bool
View Source
var FILE_PATH string
View Source
var GO_PATH string
View Source
var GO_ROOT string
View Source
var IsError = DefaultIsError
IsError print error
View Source
var LAST_CPU_CALL, LAST_RAM_CALL int64
View Source
var LOG *logging.Logger
View Source
var NUM_CPU float64
View Source
var TIMETRACK_MIN_DURATION float64
Functions ¶
func CreateFile ¶
CreateFile create file with specific content
func DefaultIsError ¶
DefaultIsError function that prints error with stacktrace
func PipeRunCmd ¶
PipeRunCmd run cmd and pipe to stdout
func PrintParent ¶
func PrintParent(any ...any)
PrintParent print but show grandparent caller function
func ReadFileLines ¶
ReadFileLines read file content line by line
func StackTrace ¶
StackTrace get a stacktrace as string
L.StackTrace(0) // until current function L.StackTrace(1) // until function that call this function
Types ¶
type CallInfo ¶
func CallerChain ¶
CallerChain return caller chain until specific skipFrom 1 to 2 will return from parent caller until grandparent
func CallerInfo ¶
CallerInfo return caller info default skip is 1, equal to parent caller
Click to show internal directories.
Click to hide internal directories.