hooks

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FeishuHook

type FeishuHook struct {
	WebhookURL string
	AppName    string
	Enabled    bool // 开关,方便测试时禁用
}

FeishuHook 飞书通知钩子示例 使用方式:log.AddHook(&hooks.FeishuHook{WebhookURL: "your-webhook-url"})

func (*FeishuHook) Fire

func (h *FeishuHook) Fire(entry *log.LogEntry) error

Fire 当有匹配级别的日志时触发

func (*FeishuHook) Levels

func (h *FeishuHook) Levels() []zapcore.Level

Levels 返回关注的日志级别

type MockFeishuHook

type MockFeishuHook struct {
	Messages []string // 保存收到的消息
}

MockFeishuHook 模拟飞书钩子(用于测试,不实际发送)

func (*MockFeishuHook) Fire

func (h *MockFeishuHook) Fire(entry *log.LogEntry) error

func (*MockFeishuHook) Levels

func (h *MockFeishuHook) Levels() []zapcore.Level

Jump to

Keyboard shortcuts

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