Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiscordWorker ¶
type DiscordWorker struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker( db *sqlx.DB, rc *redis.Client, session *discordgo.Session, cmdst commandst.CommandsSender, logger *zap.Logger, ) *DiscordWorker
NewWorker creates a new discord worker service
func (*DiscordWorker) AddCommandWorker ¶
func (d *DiscordWorker) AddCommandWorker(command, queue string)
func (*DiscordWorker) OnMessageHandler ¶
func (d *DiscordWorker) OnMessageHandler()
OnMessageHandler ...
func (*DiscordWorker) Open ¶
func (d *DiscordWorker) Open() error
type EventRegistrar ¶
type EventRegistrar struct {
// contains filtered or unexported fields
}
EventRegistrar contains events and subscribes observers on events
func NewEventRegistrar ¶
func NewEventRegistrar(logger *zap.Logger) *EventRegistrar
NewEventRegistrar creates a new EventRegistrar
func (*EventRegistrar) Notify ¶
func (er *EventRegistrar) Notify(event string, message MessageEvent)
Notify triggers the event observer
func (*EventRegistrar) Register ¶
func (er *EventRegistrar) Register(event string, observer Observer)
Register create new event observer and register observer
type MessageEvent ¶
type Observer ¶
type Observer interface {
Notify(e *MessageEvent)
}
type RabbitCommandObserver ¶
type RabbitCommandObserver struct {
// contains filtered or unexported fields
}
func NewRabbitCommandObserver ¶
func NewRabbitCommandObserver(queue string, cmdSender commandst.CommandsSender, logger *zap.Logger) *RabbitCommandObserver
func (*RabbitCommandObserver) GetId ¶
func (r *RabbitCommandObserver) GetId() uuid.UUID
func (*RabbitCommandObserver) Notify ¶
func (r *RabbitCommandObserver) Notify(e *MessageEvent)
Click to show internal directories.
Click to hide internal directories.