Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicNotificationMessage ¶
BasicNotificationMessage 是一个泛型接口,Message 可以返回不同类型
type GeneratedMessage ¶ added in v0.1.5
type GeneratedMessage[T any] struct { Data T }
GeneratedMessage 兼容动态数据
func (*GeneratedMessage[T]) Message ¶ added in v0.1.5
func (m *GeneratedMessage[T]) Message() (T, error)
type Notifier ¶
type Notifier[T any] interface { Send(ctx context.Context, message BasicNotificationMessage[T]) (bool, error) }
Notifier 是一个发送通知的接口,T 是 BasicNotificationMessage 的返回类型
type NotifierWrap ¶ added in v0.1.3
func WrapNotifierDynamic ¶ added in v0.1.5
func WrapNotifierDynamic[T any](notifier Notifier[T], messageGen func() ( BasicNotificationMessage[T], error)) NotifierWrap
func WrapNotifierStatic ¶ added in v0.1.5
func WrapNotifierStatic[T any](notifier Notifier[T], message BasicNotificationMessage[T]) NotifierWrap
WrapNotifierStatic 方法,支持静态和动态消息生成
type NotifierWrapper ¶ added in v0.1.3
type NotifierWrapper[T any] struct { Notifier Notifier[T] Message BasicNotificationMessage[T] MessageGen func() (BasicNotificationMessage[T], error) }
type SystemNotify ¶ added in v0.1.3
type SystemNotify struct {
Notify []NotifierWrap
}
func NewSystemNotify ¶ added in v0.1.3
func NewSystemNotify() *SystemNotify
func (*SystemNotify) AddNotify ¶ added in v0.1.3
func (n *SystemNotify) AddNotify(notifier NotifierWrap)
Click to show internal directories.
Click to hide internal directories.