status

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(e Entry)

Add 添加一条状态条目。如果 Time 为零值则自动设为当前时间。

func HasProblems

func HasProblems() bool

HasProblems 是否存在 warn 或 error 级别的条目

func Reset

func Reset()

Reset 清空所有条目(测试用)

Types

type Entry

type Entry struct {
	Level   Level     `json:"level"`
	Source  string    `json:"source"`
	Message string    `json:"message"`
	Detail  string    `json:"detail"`
	Time    time.Time `json:"time"`
}

Entry 单条状态条目

func List

func List() []Entry

List 返回所有条目的副本

type Level

type Level string

Level 状态级别

const (
	LevelInfo  Level = "info"
	LevelWarn  Level = "warn"
	LevelError Level = "error"
)

Jump to

Keyboard shortcuts

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