notify

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateBlue   = "blue"
	TemplateOrange = "orange"
	TemplateRed    = "red"
)

Card templates (Lark/Feishu header colors).

Variables

This section is empty.

Functions

func NewBot

func NewBot(url, serviceName string)

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

Bot posts interactive cards to a single webhook URL (Lark/Feishu bot). Each bot has its own URL, so create one Bot per notification target.

func GetBot

func GetBot() *Bot

func (*Bot) Notify

func (bot *Bot) Notify(level slog.Level, title, msg string)

Notify sends msg to the registered bot, if any and not disabled.

type Card

type Card struct {
	MsgType string   `json:"msg_type"`
	Card    cardBody `json:"card"`
}

Card mirrors a single-block Lark/Feishu interactive card payload.

func NewCard

func NewCard(title, template, content string) Card

NewCard builds a single-block interactive card

Jump to

Keyboard shortcuts

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