Documentation
¶
Index ¶
- Constants
- Variables
- func BlockMessage(title string, content []string)
- func Blue(s string)
- func BlueBg(s string)
- func BoxError(_title string, _content string)
- func BoxInfo(_title string, _content string)
- func BoxMessage(_title string, _content string)
- func BoxSuccess(_title string, _content string)
- func BoxWarning(_title string, _content string)
- func BytesToString(b []byte) string
- func CallCost() *funcCaller
- func Check(err error)
- func CheckVar(name string, a any)
- func ColorTextLength(ctx string) int
- func Common()
- func ContentLeftAlign(ctx string, length int) string
- func DrawBlockLine(length int, s1 string, s2 string, s3 string)
- func DrawBottom(lengthList []int)
- func DrawCallerTable(titleList []string, lengthList []int)
- func DrawLine(__type__ int, lengthList []int)
- func DrawMiddle(lengthList []int)
- func DrawTableContent(content []string, length []int)
- func DrawTableLine(length []int, left string, seq string, split string, right string)
- func DrawTop(lengthList []int)
- func DrawTopContent(titleList []string, lengthList []int)
- func ExecutePath() string
- func FatalMsg(title, content string)
- func FileLogFormat(title, content string)
- func Green(s string)
- func GreenBg(s string)
- func InfoMsg(title, content string)
- func MaxLength(s []string) int
- func MiddleAlign(ctx string, length int) string
- func Must(err error)
- func NoteMsg(title, content string)
- func PrintTimerLogs()
- func PrintVariables()
- func Recover()
- func Red(s string)
- func RedBg(s string)
- func Render(ctx string, rgb string) string
- func SetOutput(w io.Writer)
- func SetOutputFile(src string)
- func SetOutputTemp()
- func Silent()
- func StringLen(s string) int
- func StringToBytes(s string) []byte
- func SuccessMsg(title, content string)
- func TableMessage(_title []string, _content [][]string)
- func TerminalLogFormat(title, content string)
- func TimerStart() *timer
- func Timestamp() string
- func TitleMiddleAlign(ctx string, length int) string
- func UnixTime() int64
- func WarningMsg(title, content string)
- func Yellow(s string)
- func YellowBg(s string)
- type Variable
Constants ¶
View Source
const ( TopLeft = "╭" TopMiddle = "┬" TopRight = "╮" MiddleLeft = "├" MiddleCenter = "┼" MiddleRight = "┤" HLine = "─" VLine = "│" BottomLeft = "╰" BottomMiddle = "┴" BottomRight = "╯" )
Variables ¶
View Source
var ( CallerList = []*funcCaller{} MainStart = time.Now() )
View Source
var ( Info = infoRender Warning = warningRender Fatal = fatalRender Success = successRender )
View Source
var ( VariableList = []Variable{} PrintBuffer = strings.Builder{} TitleColor = "\033[1;36m" // TODO ColorList ColorList = []string{} TableMaxLength = 28 TopNotationList = []string{"╭", "─", "┬", "╮\n"} MiddleNotationList = []string{"├", "─", "┼", "┤\n"} BottomNotationList = []string{"╰", "─", "┴", "╯\n"} )
View Source
var (
StringBuilder = strings.Builder{}
)
Functions ¶
func BlockMessage ¶
func BoxMessage ¶
func BoxSuccess ¶
func BoxWarning ¶
func BytesToString ¶
BytesToString converts bytes to a string without memory allocation. NOTE: The given bytes MUST NOT be modified since they share the same backing array with the returned string.
func ColorTextLength ¶
func ContentLeftAlign ¶
func DrawBottom ¶
func DrawBottom(lengthList []int)
func DrawCallerTable ¶ added in v0.0.2
func DrawMiddle ¶
func DrawMiddle(lengthList []int)
func DrawTableContent ¶
func DrawTableLine ¶
func DrawTopContent ¶
func ExecutePath ¶
func ExecutePath() string
func FileLogFormat ¶ added in v0.0.3
func FileLogFormat(title, content string)
time file:line Error title Error content
func MiddleAlign ¶
func PrintTimerLogs ¶
func PrintTimerLogs()
func PrintVariables ¶
func PrintVariables()
func SetOutputFile ¶ added in v0.0.2
func SetOutputFile(src string)
func SetOutputTemp ¶ added in v0.0.2
func SetOutputTemp()
func StringToBytes ¶
reference : https://github.com/josestg/zerocast StringToBytes converts a string to a byte slice without memory allocation. NOTE: The returned byte slice MUST NOT be modified since it shares the same backing array with the given string.
func SuccessMsg ¶ added in v0.0.3
func SuccessMsg(title, content string)
func TableMessage ¶
func TerminalLogFormat ¶ added in v0.0.3
func TerminalLogFormat(title, content string)
func TimerStart ¶
func TimerStart() *timer
func TitleMiddleAlign ¶
func WarningMsg ¶ added in v0.0.3
func WarningMsg(title, content string)
Types ¶
Click to show internal directories.
Click to hide internal directories.