factory

package
v1.6.21 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllMessageSenderNames

func GetAllMessageSenderNames() []string

func GetAllMessageSenders

func GetAllMessageSenders() map[string]IMessageSender

func GetSenderConfigs

func GetSenderConfigs() map[string][]item.Item

func Initialize

func Initialize()

func RegisterMessageSender

func RegisterMessageSender(constructor MessageSenderConstructor)

Types

type Configuration

type Configuration interface{}

type IEventMessageSender

type IEventMessageSender interface {
	SendEvent(event models.EventMessage) error
}

IEventMessageSender 是可选接口,如果实现则可以接收结构化的事件消息

type IMessageSender

type IMessageSender interface {
	GetName() string
	// 请务必返回 &Configuration{} 的指针
	GetConfiguration() Configuration
	SendTextMessage(message, title string) error
	Init() error
	Destroy() error
}

type MessageSenderConstructor

type MessageSenderConstructor func() IMessageSender

func GetConstructor

func GetConstructor(name string) (MessageSenderConstructor, bool)

Jump to

Keyboard shortcuts

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