events

package
v0.0.0-...-70bfa02 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventDispatcher

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

func NewEventDispatcher

func NewEventDispatcher() *EventDispatcher

func (*EventDispatcher) ItemConsumed

func (ed *EventDispatcher) ItemConsumed(userID uint32, username string, itemID uint32, itemName string, itemCost int32, count uint32)

TODO should the username be passed in????

func (*EventDispatcher) Register

func (ed *EventDispatcher) Register(handler EventHandlerInterface)

type EventHandlerInterface

type EventHandlerInterface interface {
	//TODO should the username be passed in????
	ItemConsumed(userID uint32, username string, itemID uint32, itemName string, itemCost int32, count uint32)
	//SORRY adding the following extension to the interface is an evil hack, abusing the concept
	// but required to implement the desired behavior with minimal change
	//If anybody feels like it, please feel free to improve!
	TotalItemConsumedForUserChanged(userID uint32, username string, itemID uint32, itemName string, itemCost int32, totalCount uint32)
	//SORRY adding the following extension to the interface is an even MORE evil hack, abusing the concept even harder
	// but required to implement the desired behavior with minimal change
	//If anybody feels like it, please feel free to improve!
	TotalItemConsumedChanged(itemID uint32, itemName string, itemCost int32, totalCount uint32)
}

type EventHandlerMqtt

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

func NewEventHandlerMqtt

func NewEventHandlerMqtt(connectionString string, clientID string, topic string, username string, password string, retainMessage bool) *EventHandlerMqtt

TODO - switch constructor to using config struct instead of droelf parameters

func (*EventHandlerMqtt) ItemConsumed

func (eh *EventHandlerMqtt) ItemConsumed(userID uint32, username string, itemID uint32, itemName string, itemCost int32, count uint32)

func (*EventHandlerMqtt) TotalItemConsumedChanged

func (eh *EventHandlerMqtt) TotalItemConsumedChanged(itemID uint32, itemName string, itemCost int32, totalCount uint32)

SORRY adding the following is an even more evil hack, abusing the concept even more but required to implement the desired behavior with minimal change If anybody feels like it, please feel free to improve!

func (*EventHandlerMqtt) TotalItemConsumedForUserChanged

func (eh *EventHandlerMqtt) TotalItemConsumedForUserChanged(userID uint32, username string, itemID uint32, itemName string, itemCost int32, totalCount uint32)

SORRY adding the following is an evil hack, abusing the concept but required to implement the desired behavior with minimal change If anybody feels like it, please feel free to improve!

type EventHandlerStatsRepos

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

func NewEventHandlerStatsRepos

func NewEventHandlerStatsRepos(itemStatsRepo items.ItemStatsRepositoryInterface, userItemsStatsRepo users.UserItemsStatsRepositoryInterface, eventHandlerMessaging EventHandlerInterface) *EventHandlerStatsRepos

func (*EventHandlerStatsRepos) ItemConsumed

func (eh *EventHandlerStatsRepos) ItemConsumed(userID uint32, username string, itemID uint32, itemName string, itemCost int32, count uint32)

func (*EventHandlerStatsRepos) TotalItemConsumedChanged

func (eh *EventHandlerStatsRepos) TotalItemConsumedChanged(itemID uint32, itemName string, itemCost int32, totalCount uint32)

SORRY adding the following is an even more evil hack, abusing the concept even more but required to implement the desired behavior with minimal change If anybody feels like it, please feel free to improve!

func (*EventHandlerStatsRepos) TotalItemConsumedForUserChanged

func (eh *EventHandlerStatsRepos) TotalItemConsumedForUserChanged(userID uint32, username string, itemID uint32, itemName string, itemCost int32, totalCount uint32)

SORRY adding the following is an evil hack, abusing the concept but required to implement the desired behavior with minimal change If anybody feels like it, please feel free to improve!

type ItemConsumedMessage

type ItemConsumedMessage struct {
	EventSource string
	EventName   string
	EventTime   int64
	UserID      uint32
	ItemID      uint32
	ItemName    string
	ItemCost    int32
	ItemCount   uint32
}

func NewItemConsumedMessage

func NewItemConsumedMessage(eventTime int64, userID uint32, itemID uint32, itemName string, itemCost int32, count uint32) *ItemConsumedMessage

type TotalItemConsumedChangedMessage

type TotalItemConsumedChangedMessage struct {
	EventSource    string
	EventName      string
	EventTime      int64
	ItemID         uint32
	ItemName       string
	ItemCost       int32
	TotalItemCount uint32
}

func NewTotalItemConsumedChangedMessage

func NewTotalItemConsumedChangedMessage(eventTime int64, itemID uint32, itemName string, itemCost int32, totalCount uint32) *TotalItemConsumedChangedMessage

type TotalItemConsumedForUserChangedMessage

type TotalItemConsumedForUserChangedMessage struct {
	EventSource    string
	EventName      string
	EventTime      int64
	UserID         uint32
	ItemID         uint32
	ItemName       string
	ItemCost       int32
	TotalItemCount uint32
}

func NewTotalItemConsumedForUserChangedMessage

func NewTotalItemConsumedForUserChangedMessage(eventTime int64, userID uint32, itemID uint32, itemName string, itemCost int32, totalCount uint32) *TotalItemConsumedForUserChangedMessage

Jump to

Keyboard shortcuts

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