alert

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorMsg = MsgBox{
		TypeText:  "ERROR",
		TypeColor: "red1",
		Code:      1,
	}
	SuccessMsg = MsgBox{
		TypeText:  "SUCCESS",
		TypeColor: "green",
		Code:      0,
	}
	InfoMsg = MsgBox{
		TypeText:  "INFO",
		TypeColor: "cyan",
		Code:      0,
	}
	WarningMsg = MsgBox{
		TypeText:  "WARNING",
		TypeColor: "yellow",
		Code:      0,
	}
)

Functions

func Error

func Error(format string, v ...any) int

Error tips message print

func Info

func Info(format string, v ...any) int

Info tips message print

func Success

func Success(format string, v ...any) int

Success tips message print

func Warning

func Warning(format string, v ...any) int

Warning tips message print

Types

type MsgBox

type MsgBox struct {
	TypeText  string
	TypeColor string
	Content   string
	Code      int
}

func New

func New(typeText, content string, code int) *MsgBox

New creates a message box.

func (MsgBox) Println

func (m MsgBox) Println() int

Println prints the message box and returns its code.

func (MsgBox) Render

func (m MsgBox) Render() string

Render formats the message box as a banner string.

func (MsgBox) WithContent

func (m MsgBox) WithContent(format string, v ...any) MsgBox

WithContent returns a copy of the message box with content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL