feat: 增加推送通知配置

This commit is contained in:
yml2213
2026-06-19 16:28:49 +08:00
parent a4cdc3e806
commit 5ff1ea40b0
15 changed files with 1376 additions and 51 deletions
@@ -0,0 +1,23 @@
package push
import (
"context"
"errors"
)
var ErrProviderConfigInvalid = errors.New("push provider config invalid")
// Message 描述一条待发送的推送消息。
type Message struct {
Title string
Content string
}
// Provider 是站外推送渠道的统一接口。
// 实现方负责具体的 HTTP 调用(Bark、WPush 等)。
type Provider interface {
// Name 返回渠道标识,用于日志。
Name() string
// Send 发送一条推送消息。失败时返回 error。
Send(ctx context.Context, msg Message) error
}